unlock_and_mount.sh aktualisiert
Auf einmalige Passworteingabe umgestellt.
This commit is contained in:
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user