From: Nicolas Boisselier Date: Wed, 13 Jun 2018 11:53:52 +0000 (+0100) Subject: etc/profile.d/functions X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=fd4840f53c40b6290f526080939c83cc82c0e4c2;p=nb.git etc/profile.d/functions --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index ca658bea..5aafe57d 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -768,9 +768,10 @@ http_head() { fi } -random_string() { +password_create() { local len=${1:-30} - local chars=${2:-'[:alnum:] #$,;.:*@[]()?+=_%-'} + #local chars=${2:-'[:alnum:] #$,;.:*@[]()?+=_%-'} + local chars=${2:-'[:alnum:]#$,.@+=_-'} tr -cd "$chars" < /dev/urandom | head -c${1:-${len}} echo }