From 18ea3df3d2878e0051e549fe880f0dbda7991fbf Mon Sep 17 00:00:00 2001 From: anmol Date: Sun, 4 Nov 2018 23:48:15 +0530 Subject: [PATCH] Random string --- scripts/_common.sh | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 6cd0293..09b12c1 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -14,7 +14,7 @@ ynh_delete_file_checksum () { # usage: ynh_string_random [length] # | arg: length - the string length to generate (default: 24) -ynh_string_random() { +ynh_random() { 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' diff --git a/scripts/install b/scripts/install index c238615..5287a3a 100755 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ path_url="/" admin=$YNH_APP_ARG_ADMIN admin_email=$(ynh_user_get_info $admin 'mail') is_public=$YNH_APP_ARG_IS_PUBLIC -random_key=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) +random_key=$(ynh_random 64) name=$YNH_APP_ARG_NAME