Some more fixing on unmounting when killing script

This commit is contained in:
Le0xFF 2022-07-27 22:01:13 +02:00
parent f14a0d31f5
commit 791ce7fcbb

6
vli.sh
View File

@ -36,7 +36,7 @@ function kill_script {
echo -e -n "\n\n${RED_LIGHT}Kill signal captured, unmonting, cleaning and closing everything...${NORMAL}\n"
if grep -q /dev/mapper /proc/mounts ; then
if [[ -b /dev/mapper/"$encrypted_name" ]] ; then
if grep -q /mnt /proc/mounts ; then
for dir in sys dev proc ; do
umount /mnt/$dir
@ -45,7 +45,9 @@ function kill_script {
umount -l /mnt
if [[ "$lvm_yn" == "y" ]] || [[ "$lvm_yn" == "Y" ]] ; then
if [[ -n "$lv_root_name" ]] ; then
lvchange -an /dev/mapper/"$vg_name"-"$lv_root_name"
lvchange -an /dev/mapper/"$vg_name"-"$lv_root_name"
else
vgchange -an /dev/mapper/"$vg_name"
fi
fi
else