Drobne poprawki

This commit is contained in:
Marek Miklewicz
2023-06-04 23:08:04 +02:00
parent 74fbece785
commit f36f60606f
2 changed files with 7 additions and 13 deletions
+7 -1
View File
@@ -343,10 +343,16 @@ echo "Generowanie maila powitalnego"
cd $DAPOSTINSTALL_DIR cd $DAPOSTINSTALL_DIR
chmod 755 da_cli.sh chmod 755 da_cli.sh
echo "Generowanie hasla DirectAdmin"
min_length=8
max_length=18
DA_ADMINPASS=$(tr -dc '[:alnum:]' < /dev/urandom | fold -w "$((RANDOM % (max_length - min_length + 1) + min_length))" | grep -E '[[:digit:]]' | grep -E '[[:upper:]]' | head -n 1)
DA_OPTIONSCONF=$CBDIR/options.conf DA_OPTIONSCONF=$CBDIR/options.conf
DA_USERCONF=$DADIR/data/users/admin/user.conf DA_USERCONF=$DADIR/data/users/admin/user.conf
DA_HOSTNAME=$(hostname -f) DA_HOSTNAME=$(hostname -f)
sh pwgen.sh
DA_IP=`cat $DA_USERCONF | grep ip= | cut -d= -f2` DA_IP=`cat $DA_USERCONF | grep ip= | cut -d= -f2`
DA_NS1=`cat $DA_USERCONF | grep ns1= | cut -d= -f2` DA_NS1=`cat $DA_USERCONF | grep ns1= | cut -d= -f2`
DA_NS2=`cat $DA_USERCONF | grep ns1= | cut -d= -f2` DA_NS2=`cat $DA_USERCONF | grep ns1= | cut -d= -f2`
-12
View File
@@ -1,12 +0,0 @@
#!/bin/bash
min_length=8
max_length=18
generate_password() {
local length=$((RANDOM % (max_length - min_length + 1) + min_length))
local password=$(tr -dc '[:alnum:]' < /dev/urandom | fold -w "$length" | grep -E '[[:digit:]]' | grep -E '[[:upper:]]' | head -n 1)
echo "$password"
}
DA_ADMINPASS=$(generate_password)