Drobne poprawki
This commit is contained in:
+7
-1
@@ -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`
|
||||||
|
|||||||
@@ -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)
|
|
||||||
Reference in New Issue
Block a user