# mwes 1.0 un-install script
# Note. this script should be run as root

# check we're running as root
if [ `id -u` != 0 ]; then
 echo "Error: Installation must be performed as root user"
 exit 1
fi


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# init.d only
#/etc/init.d/mwesd stop
#sleep 2

# systemd only
echo "stopping service mwes"
systemctl stop mwes
sleep 2
echo "disable service mwes"
systemctl disable mwes
sleep 2

echo "remove mwes files"
rm -f /etc/mwes.conf
rm -f /etc/init.d/mwesd
rm -f /etc/systemd/system/mwes.service
rm -fr /var/run/mwes
rm -fr /opt/mwes

echo "remove user mwes"
userdel mwes


