From 16be72c7aec01963d496d0e971e20cb0aa99730d Mon Sep 17 00:00:00 2001 From: alf Date: Sun, 3 Aug 2025 11:15:53 +0000 Subject: [PATCH] unlock_and_mount.sh aktualisiert Auf einmalige Passworteingabe umgestellt. --- unlock_and_mount.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/unlock_and_mount.sh b/unlock_and_mount.sh index f8a8870..91b9b82 100644 --- a/unlock_and_mount.sh +++ b/unlock_and_mount.sh @@ -7,6 +7,12 @@ DRIVES[kleine]="/dev/sdd1" DRIVES[media]="/dev/sdc" DRIVES[eintb]="/dev/sda" + +# Passworteingabe, einmalig + echo -n " 🔐 Passwort für eingeben: " + read -rs PASSWD + echo + for MAPPER in "${!DRIVES[@]}"; do DEVICE="${DRIVES[$MAPPER]}" echo ">>> Verarbeite $MAPPER ($DEVICE)" @@ -18,11 +24,9 @@ for MAPPER in "${!DRIVES[@]}"; do # Entsperren if [ ! -e "/dev/mapper/$MAPPER" ]; then - echo -n " 🔐 Passwort für $MAPPER eingeben: " - read -rs PASSWD - echo # echo "$PASSWD" | sudo cryptsetup open "$DEVICE" "$MAPPER" --type luks --key-file=- TMPFILE=$(mktemp) + echo -n "$PASSWD" > "$TMPFILE" chmod 600 "$TMPFILE" sudo cryptsetup open "$DEVICE" "$MAPPER" --type luks --key-file="$TMPFILE"