summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-10-14 12:56:20 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-10-14 12:56:20 -0300
commitab62e77f3f927ef3f35ecc5c8d1bbd4650fd94b4 (patch)
treec1d6013844b287c99558221ddebb4816c831ab94
parentc4a8a321b33f0b3e67997220eabaf8cb57918adc (diff)
downloadhydra-ab62e77f3f927ef3f35ecc5c8d1bbd4650fd94b4.tar.gz
hydra-ab62e77f3f927ef3f35ecc5c8d1bbd4650fd94b4.tar.bz2
Fixes mount-media
-rwxr-xr-xshare/hydractl/mount-media16
1 files changed, 8 insertions, 8 deletions
diff --git a/share/hydractl/mount-media b/share/hydractl/mount-media
index 6916439..468eb7e 100755
--- a/share/hydractl/mount-media
+++ b/share/hydractl/mount-media
@@ -17,6 +17,11 @@ if [ -z "$MEDIA" ]; then
exit 1
fi
+# Set sudo config
+if [ "`whoami`" != 'root' ]; then
+ sudo="sudo"
+fi
+
# Check volume config
if [ -z "$VOLUME" ]; then
VOLUME="sdb1"
@@ -30,12 +35,7 @@ DEVICE="/dev/$DISK"
if $sudo lvdisplay /dev/$MEDIA/root &> /dev/null; then
LVM="yes"
DEVICE="/dev/$MEDIA/root"
- MAPPING="$MAPPING-root"
-fi
-
-# Set sudo config
-if [ "`whoami`" != 'root' ]; then
- sudo="sudo"
+ MAPPING="$MAPPING-unlocked"
fi
if [ "$BASENAME" == "mount-media" ]; then
@@ -48,7 +48,7 @@ if [ "$BASENAME" == "mount-media" ]; then
fi
if [ "$LVM" == "yes" ]; then
- $sudo vgchange -a y $VOLUME
+ $sudo vgchange -a y $MEDIA
fi
echo "Initializing crypto layer..."
@@ -65,6 +65,6 @@ elif [ "$BASENAME" == "umount-media" ]; then
$sudo cryptsetup luksClose $MAPPING
if [ "$LVM" == "yes" ]; then
- $sudo vgchange -a n $VOLUME
+ $sudo vgchange -a n $MEDIA
fi
fi