|
@ -257,13 +257,14 @@ str_matches() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
gen_password() { |
|
|
gen_password() { |
|
|
python -c 'import random; \ |
|
|
|
|
|
xx = "azertyuiopqsdfghjklmwxcvbn1234567890AZERTYUIOPQSDFGHJKLMWXCVBN+_-"; \ |
|
|
|
|
|
print "".join([xx[random.randint(0, len(xx)-1)] for x in range(0, 14)])' |
|
|
|
|
|
|
|
|
local l=( {a..z} {A..Z} {0..9} ) nl="${#l[@]}" size=${1:-16} |
|
|
|
|
|
while ((size--)); do |
|
|
|
|
|
echo -n "${l[$((RANDOM * nl / 32768))]}" |
|
|
|
|
|
done |
|
|
|
|
|
echo |
|
|
} |
|
|
} |
|
|
export -f gen_password |
|
|
export -f gen_password |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file_put() { |
|
|
file_put() { |
|
|
local TARGET="$1" |
|
|
local TARGET="$1" |
|
|
mkdir -p "$(dirname "$TARGET")" && |
|
|
mkdir -p "$(dirname "$TARGET")" && |
|
|