Browse Source

new: replaced ``gen_passwd`` by a much more quicker implementation.

raw-remaining-args
Valentin Lab 9 years ago
parent
commit
1f86ceb968
  1. 9
      bin/compose

9
bin/compose

@ -257,13 +257,14 @@ str_matches() {
}
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
file_put() {
local TARGET="$1"
mkdir -p "$(dirname "$TARGET")" &&

Loading…
Cancel
Save