freebsd-ports/net-mgmt/smokeping/pkg-deinstall
Oliver Eikemeier affeba3053 - Update to 1.26
- Use OPTIONS for optional dependencies
- Change pkg-{,de}install to avoid risk of data loss when upgrading
- Patch files instead of regexps in Makefile

added a work around for PR 63293

PR:		63230
Submitted by:	Lars Thegler <lars@thegler.dk> (maintainer)
Reviewed by:	clement
2004-02-24 12:41:38 +00:00

56 lines
1.3 KiB
Bash

#!/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