Merge remote-tracking branch 'origin/unstable' into unstable

This commit is contained in:
Weblate 2015-11-30 21:25:14 +01:00
commit 48816b374e
2 changed files with 11 additions and 7 deletions

View file

@ -1,7 +0,0 @@
# Generate a random password
#
# usage: ynh_password
ynh_password() {
echo $(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p')
}

View file

@ -0,0 +1,11 @@
# Generate a random string
#
# example: pwd=$(ynh_string_random 8)
#
# usage: ynh_string_random [length]
# | arg: length - the string length to generate (default: 24)
ynh_string_random() {
dd if=/dev/urandom bs=1 count=200 2> /dev/null \
| tr -c -d '[A-Za-z0-9]' \
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
}