#!/bin/bash
+source /usr/local/bin/library.sh;
+
launcher="/home/${USER}/.config/xfce4/panel/launcher-14/16844255236.desktop";
function main_unlock() {
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;
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