generate passwords
This commit is contained in:
@@ -142,6 +142,13 @@ zipr() {
|
|||||||
# cd -
|
# cd -
|
||||||
#}
|
#}
|
||||||
|
|
||||||
|
generate_password() {
|
||||||
|
local length=30
|
||||||
|
local chars='A-Za-z0-9!@#$%^&*()_+[]{}|;:,.<>?'
|
||||||
|
tr -dc "$chars" < /dev/urandom | head -c $length
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
randoms() {
|
randoms() {
|
||||||
echo "----------"
|
echo "----------"
|
||||||
|
|
||||||
@@ -158,10 +165,12 @@ randoms() {
|
|||||||
randstr0="${randnum} ${ranwrd1} ${ranwrd2} ${rancmd}_${randalp}"
|
randstr0="${randnum} ${ranwrd1} ${ranwrd2} ${rancmd}_${randalp}"
|
||||||
randstr1="${randnum}_${ranwrd1}_${ranwrd2}_${rancmd}${randalp}"
|
randstr1="${randnum}_${ranwrd1}_${ranwrd2}_${rancmd}${randalp}"
|
||||||
randstr2="${randnum}${ranwrd1}${ranwrd2}${rancmd//[^[:alpha:]]/}${randalp}"
|
randstr2="${randnum}${ranwrd1}${ranwrd2}${rancmd//[^[:alpha:]]/}${randalp}"
|
||||||
|
randstr3=$(generate_password)
|
||||||
|
|
||||||
echo "s0: ${randstr0}"
|
echo "s0: ${randstr0}"
|
||||||
echo "s1: ${randstr1}"
|
echo "s1: ${randstr1}"
|
||||||
echo "s2: ${randstr2}"
|
echo "s2: ${randstr2}"
|
||||||
|
echo "s3: ${randstr3}"
|
||||||
|
|
||||||
echo "----------"
|
echo "----------"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user