2019-02-23 18:49:30 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ ! -d "$1" ]
|
|
|
|
then
|
|
|
|
echo Oups, please supply a valid root directory.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ROOT="${1%/}"
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -x "$ROOT"/usr/bin/wmbusmeters ] || [ -x "$ROOT"/usr/sbin/wmbusmeters ]
|
2019-02-23 18:49:30 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm -f "$ROOT"/usr/bin/wmbusmeters "$ROOT"/usr/sbin/wmbusmetersd
|
|
|
|
echo binaries: removed "$ROOT"/usr/bin/wmbusmeters and "$ROOT"/usr/sbin/wmbusmetersd
|
2019-02-23 18:49:30 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -f "$ROOT"/usr/share/man/man1/wmbusmeters.1.gz ]
|
2019-04-25 20:32:28 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm "$ROOT"/usr/share/man/man1/wmbusmeters.1.gz
|
|
|
|
echo man page: removed "$ROOT"/usr/share/man/man1/wmbusmeters.1.gz
|
2019-04-25 20:32:28 +00:00
|
|
|
fi
|
|
|
|
|
2019-02-23 18:49:30 +00:00
|
|
|
ID=$(id -u wmbusmeters 2>/dev/null)
|
|
|
|
|
|
|
|
if [ ! "$ID" = "" ]
|
|
|
|
then
|
|
|
|
deluser wmbusmeters
|
|
|
|
echo user: removed wmbusmeters
|
|
|
|
fi
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -d "$ROOT"/var/log/wmbusmeters/ ]
|
2019-04-25 20:32:28 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm -rf "$ROOT"/var/log/wmbusmeters/
|
|
|
|
echo log dir: removed "$ROOT"/var/log/wmbusmeters/
|
2019-04-25 20:32:28 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -f "$ROOT"/etc/logrotate.d/wmbusmeters ]
|
2019-04-25 20:32:28 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm "$ROOT"/etc/logrotate.d/wmbusmeters
|
|
|
|
echo logrotate file: removed "$ROOT"/etc/logrotate.d/wmbusmeters
|
2019-04-25 20:32:28 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -f "$ROOT"/etc/wmbusmeters.conf ]
|
2019-02-23 18:49:30 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm "$ROOT"/etc/wmbusmeters.conf
|
|
|
|
echo conf file: removed "$ROOT"/etc/wmbusmeters.conf
|
2019-02-23 18:49:30 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -d "$ROOT"/etc/wmbusmeters.d ]
|
2019-02-23 18:49:30 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm -rf "$ROOT"/etc/wmbusmeters.d
|
|
|
|
echo conf dir: removed "$ROOT"/etc/wmbusmeters.d
|
2019-02-23 18:49:30 +00:00
|
|
|
fi
|
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -f "$ROOT"/etc/systemd/system/wmbusmeters.service ]
|
2019-02-23 18:49:30 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm "$ROOT"/etc/systemd/system/wmbusmeters.service
|
|
|
|
echo systemd: removed "$ROOT"/etc/systemd/system/wmbusmeters.service
|
2019-02-23 18:49:30 +00:00
|
|
|
fi
|
2019-04-25 20:32:28 +00:00
|
|
|
|
2019-04-26 16:25:21 +00:00
|
|
|
if [ -f "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules ]
|
2019-04-25 20:32:28 +00:00
|
|
|
then
|
2019-04-26 16:25:21 +00:00
|
|
|
rm "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules
|
|
|
|
echo udev: removed "$ROOT"/etc/udev/rules.d/99-wmbus-usb-serial.rules
|
2019-04-25 20:32:28 +00:00
|
|
|
fi
|