-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall-gui.sh
48 lines (40 loc) · 1.29 KB
/
uninstall-gui.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
48
#!/bin/bash
# github.com/douxxu | git.douxx.tech/piwave-webgui
print_magenta() {
echo -e "\e[35m$1\e[0m"
}
check_status() {
if [ $? -ne 0 ]; then
echo -e "\e[31mError: $1 failed\e[0m"
exit 1
fi
}
print_magenta "
____ __ __ _ ____ _ _ ___
| _ \\__ __ \\ \\ / /__| |__ / ___| | | |_ _|
| |_) \\ \\ /\\ / / \\ \\ /\\ / / _ \\ '_ \\| | _| | | || |
| __/ \\ V V / \\ V V / __/ |_) | |_| | |_| || |
|_| \\_/\\_/ \\_/\\_/ \\___|_.__/ \\____|\\___/|___|
"
echo "Removing PiWave WebGUI aliases from .bashrc..."
if [ -f "$HOME/.bashrc" ]; then
sed -i '/# PiWave WebGUI Aliases/,/^$/d' "$HOME/.bashrc"
check_status "Removing aliases from .bashrc"
else
echo -e "\e[31mError: ~/.bashrc not found. Cannot remove aliases.\e[0m"
fi
echo "Stopping any running PiWave WebGUI processes..."
sudo pkill -f server.py
check_status "Stopping PiWave WebGUI processes"
echo "Removing PiWave WebGUI directory..."
CLONE_DIR="$HOME/piwave-webgui"
if [ -d "$CLONE_DIR" ]; then
sudo rm -rf "$CLONE_DIR"
check_status "Removing $CLONE_DIR"
else
echo "Directory $CLONE_DIR does not exist. Skipping removal."
fi
echo "Uninstalling Flask..."
sudo apt remove -y python3-flask
check_status "Uninstalling Flask"
echo "Uninstallation completed successfully!"