password generator using /dev/urandom
This commit is contained in:
parent
02d5c85677
commit
17a36aca59
23
password-gen.sh
Executable file
23
password-gen.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
alnum() {
|
||||
cat /dev/urandom | tr -dc [:alnum:] | fold -w 32 | head -1
|
||||
}
|
||||
|
||||
alnum_spec() {
|
||||
cat /dev/urandom | tr -dc [:alnum:]'!@#$%^&*()-_=+' | fold -w 32 | head -1
|
||||
}
|
||||
|
||||
_help() {
|
||||
echo 'Flags:
|
||||
a - alphanumeric set
|
||||
s - alphanumeric + special characters'
|
||||
}
|
||||
|
||||
case $1 in
|
||||
a) alnum;;
|
||||
s) alnum_spec;;
|
||||
*) _help;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user