From 2cdda1802086be7d401ba4f47a55eb886919fd27 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 21 Sep 2017 18:14:01 +0100 Subject: [PATCH] fixes #1308 as per @cedarlugs suggestion --- lgsm/functions/install_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index e342e0e04..65c1c9cf5 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -50,7 +50,7 @@ fn_default_config_remote(){ # PASSWORD to random password fn_set_config_vars(){ if [ -f "${servercfgfullpath}" ]; then - random=$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 8 | tr -d '\n'; echo) + random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) servername="LinuxGSM" rconpass="admin$random" echo "changing hostname." @@ -82,7 +82,7 @@ fn_set_dst_config_vars(){ sleep 1 echo "randomizing cluster key." fn_script_log_info "randomizing cluster key." - randomkey=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) + randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" sleep 1 else