From: xf0r3m Date: Sun, 6 Jul 2025 16:00:48 +0000 (+0200) Subject: Dostosowanie immudex-padlock do obsługi LVM. X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=892338d190f6783afe628f851140b52011d0b948;p=immudex.git Dostosowanie immudex-padlock do obsługi LVM. --- diff --git a/tools/bin/immudex-padlock b/tools/bin/immudex-padlock index 59343d7..902ce97 100755 --- a/tools/bin/immudex-padlock +++ b/tools/bin/immudex-padlock @@ -1,5 +1,7 @@ #!/bin/bash +source /usr/local/bin/library.sh; + launcher="/home/${USER}/.config/xfce4/panel/launcher-14/16844255236.desktop"; function main_unlock() { @@ -40,7 +42,7 @@ function lock() { if [ "$mapperDeviceList" ]; then for dmDevice in $mapperDeviceList; do if sudo cryptsetup status /dev/mapper/${dmDevice} > /dev/null 2>&1; then - mountPoint=$(df --output=source,target /dev/mapper/${dmDevice} | tail -n 1 | awk '{printf $2}'); + mountPoint=$(df --output=source,target /media/${USER}/${dmDevice} | tail -n 1 | awk '{printf $2}'); if [ "$mountPoint" ]; then if $(sudo lsof $mountPoint > /dev/null 2>&1); then notify-send "Padlock" "The /dev/mapper/${dmDevice} cannot be unmount, because there are opened file or running proceses." --icon=dialog-error; @@ -48,10 +50,13 @@ function lock() { sudo umount $mountPoint; if [ $? -ne 0 ]; then notify-send "Padlock" "The /dev/mapper/${dmDevice} cannot be unmount, because there are other filesystem is mounted in." --icon=dialog-error; + else + deactivate_lvm_w_swap $dmDevice; + sudo cryptsetup close /dev/mapper/${dmDevice}; fi - sudo cryptsetup close /dev/mapper/${dmDevice}; fi else + deactivate_lvm_w_swap $dmDevice; sudo cryptsetup close /dev/mapper/${dmDevice}; fi fi