#!/bin/sh

EXO_CONFIG_DIR=/etc/exoligent
UAFIP_CONFIG_DIR=${EXO_CONFIG_DIR}/uafip

systemctl disable uafipd.service
systemctl stop uafipd.service

# delete uafip config directory if exists
if [ -d "${UAFIP_CONFIG_DIR}" ]
then
   rm -rf ${UAFIP_CONFIG_DIR}
fi
# delete exoligent config directory if empty
if [ `ls ${EXO_CONFIG_DIR} | wc -l` -eq 0 ];
then
    rmdir ${EXO_CONFIG_DIR}
fi

rm /usr/bin/uafipd
rm /etc/logrotate.d/uafip
rm /etc/systemd/system/uafipd.service

systemctl daemon-reload