-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove-appimage.sh
More file actions
57 lines (46 loc) · 1.23 KB
/
remove-appimage.sh
File metadata and controls
57 lines (46 loc) · 1.23 KB
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
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
VERSION="20260416"
source /usr/local/lib/display.sh
show_syntax() {
echo "Syntax: $(basename $0) <command>"
echo "Where: <command> is the name to be used to invoke the program\n"
exit
}
# --------------------
# ------- MAIN -------
# --------------------
if [[ "$EUID" = 0 ]]; then
printx "This must be run as the standard user that will use the device.\n"
printx "It will prompt for sudo when it is needed.\n"
exit
fi
if [ $# -lt 1 ]; then
show_syntax
fi
command=$1
# Get the name of the AppImage package
cd /opt/$command
appimage=$(ls *.AppImage)
# Confirm
printx "This entirely removes the command '$command' and '$appimage' from the system."
while true; do
read -p "Do you want to proceed? (yes/no) " yn
case $yn in
yes ) echo ok, we will proceed;
printx "Proceeding to remove the application..."
break;;
no ) echo exiting...;
exit;;
* ) echo invalid response;;
esac
done
sudo ./$appimage --appimage-extract 1> /dev/null
sudo chmod 777 squashfs-root
cd squashfs-root
desktopfile=$(ls ./squashfs-root/*.desktop)
cd /opt
sudo rm /usr/local/share/applications/$desktopfile.desktop
sudo rm /usr/local/bin/$command
sudo rm -rf /opt/$command
sudo update-desktop-database
printx "Removal complete"