From 566302736efa9312f1f3688f2919793029ecfe96 Mon Sep 17 00:00:00 2001 From: Marek Miklewicz Date: Fri, 1 Dec 2023 09:55:30 +0100 Subject: [PATCH] Update dapostinstall.sh --- dapostinstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dapostinstall.sh b/dapostinstall.sh index bc9327e..48e2401 100755 --- a/dapostinstall.sh +++ b/dapostinstall.sh @@ -10,8 +10,8 @@ DADIR=/usr/local/directadmin CBDIR=/usr/local/directadmin/custombuild LOG_FILE=/var/log/dapostinstall.log HTLINK="https://ht.zenadmin.pl" -MIN_PASSWORD_LENGHT=18 -MAX_PASSWORD_LENGHT=24 +MIN_PASSWORD_LENGTH=18 +MAX_PASSWORD_LENGTH=24 exec > >(tee -ia "$LOG_FILE") 2>&1 cd $DAPOSTINSTALL_DIR yum -y install htop wget rsync nano mc ncdu borgbackup @@ -357,7 +357,7 @@ echo "Generowanie hasla DirectAdmin" DA_ADMINPASS=$( while true; do - base_part=$(tr -dc '[:alnum:]' < /dev/urandom | tr -d 'oO0l1I' | fold -w "$((RANDOM % (MAX_PASSWORD_LENGTH - MIN_PASSWORD_LENGTH) + MIN_PASSWORD_LENGTH))" | head -$ + base_part=$(tr -dc '[:alnum:]' < /dev/urandom | tr -d 'oO0l1I' | fold -w "$((RANDOM % (MAX_PASSWORD_LENGTH - MIN_PASSWORD_LENGTH) + MIN_PASSWORD_LENGTH))" | head -n1) special_char=$(tr -dc '[:graph:]' < /dev/urandom | tr -d '#oO0l1I' | fold -w 1 | head -n1) special_index=$((RANDOM % ${#base_part})) password="${base_part:0:special_index}${special_char}${base_part:special_index}"