freebsd-ports/net-mgmt/smokeping/pkg-deinstall

56 lines
1.3 KiB
Text
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
#
echo 'Stopping Smokeping daemon.'
if [ -f ${PKG_PREFIX}/var/smokeping/smokeping.pid ]; then
if [ -x ${PKG_PREFIX}/etc/rc.d/smokeping.sh ]; then
${PKG_PREFIX}/etc/rc.d/smokeping.sh stop > /dev/null
fi
rm ${PKG_PREFIX}/var/smokeping/smokeping.pid
fi
case $2 in
POST-DEINSTALL)
if [ ! -n "$BATCH" ]; then
if [ -d ${PKG_PREFIX}/etc/smokeping -o -d ${PKG_PREFIX}/var/smokeping ]; then
echo '================================================================='
echo
echo 'You seem to have some custom config and data.'
echo 'The "%%USER%%" user and "%%GROUP%%" group were therefore not deleted.'
echo
echo 'You may delete them with:'
echo
echo ' pw groupdel %%GROUP%%'
echo ' pw userdel %%USER%%'
echo
echo 'The config and data can be deleted with:'
echo
echo " rm -R ${PKG_PREFIX}/etc/smokeping"
echo " rm -R ${PKG_PREFIX}/var/smokeping"
echo
echo '================================================================='
else
if pw groupdel -n %%GROUP%%; then
echo 'Removed group "%%GROUP%%".'
else
echo 'Removing group "%%GROUP%%" failed...'
exit 1
fi
if pw userdel -n %%USER%%; then
echo 'Removed user "%%USER%%".'
else
echo 'Removing user "%%USER%%" failed...'
exit 1
fi
fi
fi
exit 0
;;
esac