-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
executable file
·49 lines (37 loc) · 1.1 KB
/
uninstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/bash
function ask_yes_no {
while true; do
read -p "$1" yn
case $yn in
[Yy]* ) $2; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
}
echo '***************************************************************************'
echo 'UNINSTALLING `mw` UTILITY'
echo '***************************************************************************'
source ./config.sh
source ./private/_config.sh
echo "Removing runtime directory..."
sudo rm -rf $RUNTIME_ROOT_DIR
echo "Removing symlink to executable script..."
sudo rm -f $BIN_PATH/mw
df -Th | grep $TARGET_MOUNT
if [ $? -eq 0 ]; then
echo "Attempting to unmount $TARGET_MOUNT"
sudo umount -l $TARGET_MOUNT
else
echo "Target mountpoint $TARGET_MOUNT is not mounted"
fi
if [ -f "$DISLOCKER_FILE" ]; then
echo "Attempting unmount of dislocker file"
sudo umount -l $FUSE_TARGET
fi
if [ -d "$LOCKER_DIRECTORY" ]; then
ask_yes_no "Remove entire directory $LOCKER_DIRECTORY including any \
encrypted keyfiles? " "sudo rm -rf $LOCKER_DIRECTORY"
fi
echo "Uninstallation Complete"
exit 0