-
-
Notifications
You must be signed in to change notification settings - Fork 199
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·27 lines (22 loc) · 683 Bytes
/
uninstall.sh
File metadata and controls
executable file
·27 lines (22 loc) · 683 Bytes
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
#!/usr/bin/env sh
set -eu
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run as root!' >&2
exit 1
fi
modules=$(lsmod | grep '^xone_' | cut -d ' ' -f 1 | tr '\n' ' ')
version=$(dkms status xone | head -n 1 | tr -s ',:/' ' ' | cut -d ' ' -f 2)
if [ -n "$modules" ]; then
echo "Unloading modules: $modules..."
# shellcheck disable=SC2086
modprobe -r -a $modules
fi
if [ -n "$version" ]; then
echo "Uninstalling xone $version..."
dkms remove -m xone -v "$version" --all
rm -r "/usr/src/xone-$version"
rm -f /etc/modprobe.d/xone-blacklist.conf
rm -f /usr/local/bin/xone-get-firmware.sh
else
echo 'Driver is not installed!' >&2
fi