exit 1
fi
+# Set sudo config
+if [ "`whoami`" != 'root' ]; then
+ sudo="sudo"
+fi
+
# Check volume config
if [ -z "$VOLUME" ]; then
VOLUME="sdb1"
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
fi
if [ "$LVM" == "yes" ]; then
- $sudo vgchange -a y $VOLUME
+ $sudo vgchange -a y $MEDIA
fi
echo "Initializing crypto layer..."
$sudo cryptsetup luksClose $MAPPING
if [ "$LVM" == "yes" ]; then
- $sudo vgchange -a n $VOLUME
+ $sudo vgchange -a n $MEDIA
fi
fi