From f0ec6d2373c5ad45d4f097e3515fd5fdb0d424af Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Sun, 1 Mar 2020 11:08:57 +0100 Subject: [PATCH] fix "command not found" --- lib.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib.sh b/lib.sh index 350c18d9..4701ca1d 100644 --- a/lib.sh +++ b/lib.sh @@ -18,18 +18,6 @@ RORDIR=/opt/es/ NC_APPS_PATH=$NCPATH/apps VMLOGS=/var/log/nextcloud -# Helper function for generating random passwords -gen_passwd() { - local length=$1 - local charset="$2" - local password="" - while [ ${#password} -lt "$length" ] - do - password=$(echo "$password""$(head -c 100 /dev/urandom | LC_ALL=C tr -dc "$charset")" | fold -w "$length" | head -n 1) - done - print_text_in_color "$ICyan" "$password" -} - # Ubuntu OS DISTRO=$(lsb_release -sd | cut -d ' ' -f 2) KEYBOARD_LAYOUT=$(localectl status | grep "Layout" | awk '{print $3}') @@ -1176,6 +1164,18 @@ do done } +# Helper function for generating random passwords +gen_passwd() { + local length=$1 + local charset="$2" + local password="" + while [ ${#password} -lt "$length" ] + do + password=$(echo "$password""$(head -c 100 /dev/urandom | LC_ALL=C tr -dc "$charset")" | fold -w "$length" | head -n 1) + done + echo "$password" +} + ## bash colors # Reset Color_Off='\e[0m' # Text Reset