[init] initial commit
This commit is contained in:
28
utool/genpw.sh
Normal file
28
utool/genpw.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo -e "\e[1;3;31mNeed ONE and only ONE digital parameter.\e[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $1 -gt 0 && $1 -lt 80 ]] 2>/dev/null; then
|
||||
echo -e "\e[1;3;31mNeed ONE DIGITAL parameter, which must be greater than 0 and lower than 80.\e[0m"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# total 80 bits password
|
||||
pwgen_0=`pwgen -sync`
|
||||
pwgen_1=`pwgen -sync`
|
||||
pwgen_2=`pwgen -sync`
|
||||
pwgen_3=`pwgen -sync`
|
||||
pwgen_4=`pwgen -sync`
|
||||
pwgen_5=`pwgen -sync`
|
||||
pwgen_6=`pwgen -sync`
|
||||
pwgen_7=`pwgen -sync`
|
||||
pwgen_8=`pwgen -sync`
|
||||
pwgen_9=`pwgen -sync`
|
||||
|
||||
pwgen_80=${pwgen_0}${pwgen_1}${pwgen_2}${pwgen_3}${pwgen_4}${pwgen_5}${pwgen_6}${pwgen_7}${pwgen_8}${pwgen_9}
|
||||
echo ${pwgen_80:0:${1}}
|
||||
|
||||
|
Reference in New Issue
Block a user