X-Git-Url: https://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=grml-crypt;h=5dcace5dd2fe384579db5c717d5401ec2d04a599;hb=6bdde2304c466c38d7e61d2d804df4df277fa5c0;hp=a205033f8683d4ce9d74cbc01c6b921a20027864;hpb=43288529ec37150503e3c70ecd88bf4db851dab7;p=grml-crypt.git diff --git a/grml-crypt b/grml-crypt index a205033..5dcace5 100755 --- a/grml-crypt +++ b/grml-crypt @@ -211,10 +211,25 @@ function actionStop dm_path_=`echo $dm_path_ |awk '{print $1}'` || die "could not get devicemapper name for $tmp_" dprint "dm_path_=\"$dm_path_\"" + # check for symlinks + unset tmp_dm_path_ + for dmapper in /dev/mapper/grml-crypt* ; do + link=$(readlink -f "$dmapper") + dprint "looping device mapper devices, dmapper=$dmapper => link=$link" + if [ "$link" = "$dm_path_" ] ; then + tmp_dm_path_="$dmapper" + fi + done + + if [ -n "$tmp_dm_path_" ] ; then + dm_path_="$tmp_dm_path_" + unset tmp_dm_path_ + fi + dm_name_="${dm_path_##*/}" dprint "dm_name_=\"$dm_name_\"" - dmsetup info $dm_name_ >/dev/null ||die "$dm_name_ is not aktive" + dmsetup info $dm_name_ >/dev/null ||die "$dm_name_ is not active" device_=`$CRYPTSETUP_ status $dm_name_ |awk '/device:/{print $2}'` || \ die "could not get underlying device of $dm_path_" dprint "device_=\"$device_\"" @@ -224,7 +239,7 @@ function actionStop echo "$device_" |grep loop &>/dev/null && execute "losetup -d $device_" \ die "could not delete loop device $device_" || \ execute "losetup -d $device_ &>/dev/null" eprint "could not delete loop device $device_, \ -this device could possible not be a loop device => maybe bogus error" +this device possibly is not a loop device => maybe bogus error" notice "$mp_ successfully unmountet/closed/deleted" }