-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathuninstall.sh
executable file
·66 lines (49 loc) · 1.75 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
59
60
61
62
63
64
65
66
#!/bin/sh
echo "Uninstalling OpenSuperClone from /usr/..."
if [ -f /usr/bin/opensuperclone ]; then
sudo rm -f /usr/bin/opensuperclone
fi
if [ -f /usr/bin/oscviewer ]; then
sudo rm -f /usr/bin/oscviewer
fi
if [ -d /usr/bin/oscscripts ]; then
sudo rm -rf /usr/bin/oscscripts
fi
if [ -f /usr/share/applications/opensuperclone.desktop ]; then
sudo rm -f /usr/share/applications/opensuperclone.desktop
fi
if [ -f /usr/share/applications/opensupertool.desktop ]; then
sudo rm -f /usr/share/applications/opensupertool.desktop
fi
if [ -f /usr/share/applications/oscviewer.desktop ]; then
sudo rm -f /usr/share/applications/oscviewer.desktop
fi
if [ -d /usr/share/locale ]; then
for locale in $(ls /usr/share/locale); do
if [ -f /usr/share/locale/$locale/LC_MESSAGES/opensuperclone.mo ]; then
sudo rm -f /usr/share/locale/$locale/LC_MESSAGES/opensuperclone.mo
fi
if [ -f /usr/share/locale/$locale/LC_MESSAGES/oscviewer.mo ]; then
sudo rm -f /usr/share/locale/$locale/LC_MESSAGES/oscviewer.mo
fi
done
fi
echo "Done uninstalling OpenSuperClone from /usr/..."
if ! command -v dkms >/dev/null; then
echo "WARNING: DKMS is not installed, skipping driver removal."
echo "If the driver was installed manually, it will not be removed."
exit 0
fi
echo "Uninstalling OSCDriver..."
if lsmod | grep -q oscdriver; then
sudo rmmod oscdriver
fi
VERSION=$(grep -oP '(?<=set\(OSC_DRIVER_VERSION ).*(?=\))' CMakeLists.txt)
VERSION=$(echo $VERSION | cut -d' ' -f1)
echo "Assuming OSCDriver version $VERSION."
sudo dkms remove -m oscdriver/$VERSION --all
if [ -d /usr/src/oscdriver-$VERSION ]; then
sudo rm -rf /usr/src/oscdriver-$VERSION
fi
echo "Done uninstalling OSCDriver."
echo "Done."