[fix] Bracket in passwd from ynh_string_random

With bracket we get string like "3KFEc[xm4[udnZ6pDJ8LvP0n"
Without "El0nMO3thacDwrjeRzgKnb30"
This commit is contained in:
ljf (zamentur) 2016-12-09 07:34:31 +01:00 committed by GitHub
parent 6a4da64be9
commit 0d6cf499a0

View file

@ -6,6 +6,6 @@
# | 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]' \
| tr -c -d 'A-Za-z0-9' \
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
}