Merge pull request #569 from YunoHost/more_blocks_ynh_string_random

[enh] Use more blocks for dd in ynh_string_random
This commit is contained in:
Alexandre Aubin 2018-11-04 19:17:01 +01:00 committed by GitHub
commit a830cdfbfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@
# 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 \
dd if=/dev/urandom bs=1 count=1000 2> /dev/null \
| tr -c -d 'A-Za-z0-9' \
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
}