forked from wmbusmeters/wmbusmeters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
executable file
·65 lines (53 loc) · 1.61 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
#!/bin/bash
if [ ! -d "$1" ]
then
echo Oups, please supply a valid root directory.
exit 1
fi
ROOT="${1%/}"
if [ -x "$ROOT"/usr/bin/wmbusmeters ] || [ -x "$ROOT"/usr/sbin/wmbusmeters ]
then
rm -f "$ROOT"/usr/bin/wmbusmeters "$ROOT"/usr/sbin/wmbusmetersd
echo binaries: removed "$ROOT"/usr/bin/wmbusmeters and "$ROOT"/usr/sbin/wmbusmetersd
fi
if [ -f "$ROOT"/usr/share/man/man1/wmbusmeters.1.gz ]
then
rm "$ROOT"/usr/share/man/man1/wmbusmeters.1.gz
echo man page: removed "$ROOT"/usr/share/man/man1/wmbusmeters.1.gz
fi
ID=$(id -u wmbusmeters 2>/dev/null)
if [ ! "$ID" = "" ]
then
userdel wmbusmeters
echo user: removed wmbusmeters
fi
if [ -d "$ROOT"/var/log/wmbusmeters/ ]
then
rm -rf "$ROOT"/var/log/wmbusmeters/
echo log dir: removed "$ROOT"/var/log/wmbusmeters/
fi
if [ -f "$ROOT"/etc/logrotate.d/wmbusmeters ]
then
rm "$ROOT"/etc/logrotate.d/wmbusmeters
echo logrotate file: removed "$ROOT"/etc/logrotate.d/wmbusmeters
fi
if [ -f "$ROOT"/etc/wmbusmeters.conf ]
then
rm "$ROOT"/etc/wmbusmeters.conf
echo conf file: removed "$ROOT"/etc/wmbusmeters.conf
fi
if [ -d "$ROOT"/etc/wmbusmeters.d ]
then
rm -rf "$ROOT"/etc/wmbusmeters.d
echo conf dir: removed "$ROOT"/etc/wmbusmeters.d
fi
if [ -f "$ROOT"/lib/systemd/system/wmbusmeters.service ]
then
rm "$ROOT"/lib/systemd/system/wmbusmeters.service
echo systemd: removed "$ROOT"/lib/systemd/system/wmbusmeters.service
fi
if [ -f "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules ]
then
rm "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules
echo udev: removed "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules
fi