Rename unmount to mount, 1 pw attempt

This commit is contained in:
Daniel A. Maierhofer
2018-07-30 17:33:15 +02:00
parent 2b53139a3e
commit 1617d3ac40

View File

@@ -55,23 +55,15 @@ function closeAllLUKS {
} }
function openAllLUKS { function openAllLUKS {
read -s -p "Enter LUKS passphrase: " pass1 read -s -p "Enter LUKS passphrase: " pass
echo ""
read -s -p "Confirm LUKS passphrase: " pass2
echo "" echo ""
if [ "$pass1" = "$pass2" ];
then
for dev in "${!devs[@]}" for dev in "${!devs[@]}"
do do
echo "Opening $dev to ${devs["$dev"]}" | tee -a $LOG echo "Opening $dev to ${devs["$dev"]}" | tee -a $LOG
echo "$pass1" | cryptsetup luksOpen $dev ${devs[$dev]} 2>&1 1>>$LOG || { echo "Problem opening $dev!" | tee -a $LOG; exit 0; } echo "$pass" | cryptsetup luksOpen $dev ${devs[$dev]} 2>&1 1>>$LOG || { echo "Problem opening $dev!" | tee -a $LOG; exit 0; }
done done
else pass=""
echo "ERROR: passphrases don't match!"
fi
pass1=""
pass2=""
} }
function LUKSStatus { function LUKSStatus {
@@ -81,7 +73,7 @@ function LUKSStatus {
done | sort done | sort
} }
function unmount { function umount {
zfs unshare -a zfs unshare -a
getPoolStatus getPoolStatus
exportActivePools exportActivePools
@@ -102,20 +94,20 @@ then
importPools importPools
getPoolStatus getPoolStatus
zfs share -a zfs share -a
elif [ "$1" = "unmount" ]; elif [ "$1" = "umount" ];
then then
unmount umount
elif [ "$1" = "reboot" ]; elif [ "$1" = "reboot" ];
then then
unmount umount
reboot reboot
elif [ "$1" = "shutdown" ]; elif [ "$1" = "shutdown" ];
then then
unmount umount
shutdown -h now shutdown -h now
elif [ "$1" = "freespace" ]; elif [ "$1" = "freespace" ];
then then
zfs list zfs list
else else
echo "Usage: ./mountVolumes.sh [status|mount|unmount|reboot|shutdown|freespace]" echo "Usage: ./mountVolumes.sh [status|mount|umount|reboot|shutdown|freespace]"
fi fi