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