Update install.sh

custom pw
This commit is contained in:
p3t4rc 2025-04-29 14:58:37 +02:00 committed by GitHub
parent 7d338d727b
commit 92c647bca1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1763,11 +1763,16 @@ create_admin_and_show_logins_success_message() {
fi
if [ "$SET_ADMIN_PASSWORD" = true ]; then
new_password="${custom_password}"
else
new_password=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)
fi
if [ "$SET_ADMIN_PASSWORD" = true ]; then
if [[ "$custom_password" =~ ^[A-Za-z0-9]{6,16}$ ]]; then
new_password="${custom_password}"
else
echo "Warning: custom_password is invalid (must be alphanumeric and 616 characters). Generating a secure password."
new_password=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)
fi
else
new_password=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)
fi
display_admin_status_and_logins() {