-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuninstall.sh
executable file
·53 lines (46 loc) · 988 Bytes
/
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
#!/bin/bash
if [ "$EUID" -ne 0 ]
then
echo "Please run as root to remove the usbip service."
exit 1
fi
for service in 'bind' 'attach'
do
if [ -f /etc/systemd/system/usbip-${service}.service ]
then
echo -n "Stopping usbip-${service} service ."
if systemctl stop usbip-${service} >/dev/null 2>&1
then
echo ". done."
else
echo ". failed."
exit 1
fi
echo -n "Disabling usbip-${service} service ."
if systemctl disable usbip-${service} >/dev/null 2>&1
then
echo ". done."
else
echo ". failed."
exit 1
fi
echo -n "Removing application files ."
rm -f /etc/systemd/system/usbip-${service}.service
rm -f /opt/usbip/usbip-${service}
echo ". done."
echo -n "Removing installation directory ."
if rmdir /opt/usbip >/dev/null 2>&1
then
echo ". done."
else
echo ". failed."
fi
echo -n "Reloading systemctl daemon ."
if systemctl daemon-reload >/dev/null 2>&1
then
echo ". done."
else
echo ". failed."
fi
fi
done