From 35364f608fa6ce279a5f2c3be0907c8170247723 Mon Sep 17 00:00:00 2001 From: RolandS <1+xosna@noreply.localhost> Date: Tue, 26 May 2026 16:06:21 +0200 Subject: [PATCH] debian_install.sh aktualisiert --- debian_install.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/debian_install.sh b/debian_install.sh index b24224a..4d1b86d 100644 --- a/debian_install.sh +++ b/debian_install.sh @@ -29,7 +29,6 @@ echo -e "${BOLD}╚════════════════════ # ── Standardwerte ────────────────────────────────────────────────────────────── DEFAULT_CTID=$(pvesh get /cluster/nextid) DEFAULT_HOSTNAME="debian" -DEFAULT_PASSWORD="ChangeMe123!" DEFAULT_DISK=4 # GB DEFAULT_RAM=512 # MB (Debian braucht wenig) DEFAULT_SWAP=512 # MB @@ -53,6 +52,23 @@ ask_yn() { [[ "${yn:-$default}" =~ ^[Jj1Yy] ]] } +ask_password() { + local prompt="$1" var_name="$2" + local pw1 pw2 + while true; do + echo -ne "${BOLD}${prompt}${NC}: " + read -rs pw1; echo "" + echo -ne "${BOLD}Passwort bestätigen${NC}: " + read -rs pw2; echo "" + if [[ "$pw1" != "$pw2" ]]; then + warn "Passwörter stimmen nicht überein – bitte erneut eingeben." + else + printf -v "$var_name" '%s' "$pw1" + break + fi + done +} + # ── Storage-Auswahl (dynamisch) ──────────────────────────────────────────────── select_storage() { echo -e "${CYAN}── Storage-Auswahl ──────────────────────────────────────────${NC}" @@ -135,7 +151,7 @@ select_storage() { echo -e "${CYAN}── Container-Grundkonfiguration ─────────────────────────────${NC}" ask "Container-ID" "$DEFAULT_CTID" CTID ask "Hostname" "$DEFAULT_HOSTNAME" HOSTNAME -ask "Root-Passwort" "$DEFAULT_PASSWORD" PASSWORD +ask_password "Root-Passwort" PASSWORD echo "" select_storage ask "Disk-Größe (GB)" "$DEFAULT_DISK" DISK