-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
58 lines (47 loc) · 1.95 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
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# github.com/douxxu | git.douxx.tech/piwave
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 / __/ | _|~ |
|_| |_| \_/\_/ \__,_| \_/\_/ \___| | (_| |~/ |
| _|~ |
.============.| (_| |~/ |
.-;____________;|. _|~ |
| [_________I__] | (_| |
| \"\"\"\"\" (_) (_) | |
| .=====..=====. | |
| |:::::||:::::| | |
| '=====''=====' | |
'----------------' |
"
echo "Stopping any running PiWave processes..."
sudo pkill -f piwave
check_status "Stopping PiWave processes"
echo "Uninstalling PiWave Python package..."
sudo pip uninstall -y piwave
check_status "Uninstalling PiWave"
echo "Removing PiFmRds directory..."
sudo rm -rf PiFmRds
check_status "Removing PiFmRds directory"
echo "Removing PiWave_deps directory..."
cd .. || { echo -e "\e[31mError: cd to parent directory failed\e[0m"; exit 1; }
sudo rm -rf PiWave_deps
check_status "Removing PiWave_deps directory"
echo "Removing installed packages..."
sudo apt remove -y python3 libsndfile1-dev make ffmpeg git
check_status "Removing installed packages"
echo "Cleaning up residual configuration and dependencies..."
sudo apt autoremove -y
check_status "Cleaning residual files"
echo "Uninstallation completed successfully!"