Fix password regex
This commit is contained in:
parent
7c8f80ab2e
commit
5cbc4e8661
6
profile
6
profile
@ -30,8 +30,8 @@ function passgen () {
|
||||
local len="$1"
|
||||
local lower="$2"
|
||||
|
||||
echo "$len" | grep -q '^[0-9]+$'
|
||||
if (( ! $? )); then
|
||||
echo "$len" | grep -E '^[0-9]+$'
|
||||
if (( $? )); then
|
||||
len=32
|
||||
fi
|
||||
|
||||
@ -40,7 +40,7 @@ function passgen () {
|
||||
local tr2="[:lower:]"
|
||||
fi
|
||||
|
||||
cat /dev/urandom | base64 | head -c $len | tr -d "\n" | \
|
||||
cat /dev/urandom | base64 | head -c "$len" | tr -d "\n" | \
|
||||
tr "$tr1" "$tr2" && echo
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user