freebsd-ports/sysutils/munin-node/pkg-deinstall
Florian Smeets 773edde1d7 - update to 2.0.14
- make port non-interactive [1]
- add PORTSCOUT hints, 2.1.X is a development version

PR:		ports/178532 [1]
Submitted by:	Claudius Herder <claudius_herder@ambtec.de> [1]
2013-05-29 23:36:16 +00:00

41 lines
905 B
Bash

#! /bin/sh
stop_process() {
STARTSTOP=${PKG_PREFIX}/etc/rc.d/munin-node
if [ -x $STARTSTOP ]; then
$STARTSTOP stop
fi
}
delnewsyslog() {
tmp="/etc/#munin-node$$"
sed -e '/^\/var\/log\/munin\/munin-node.log[ ]/d' /etc/newsyslog.conf >${tmp}
cat ${tmp} > /etc/newsyslog.conf
rm ${tmp}
}
newsyslog() {
ENTRY=`grep /var/log/munin/munin-node.log /etc/newsyslog.conf`
DEFAULT='/var/log/munin/munin-node.log 644 7 * @T00 Z /var/run/munin/munin-node.pid'
if [ -z "$ENTRY" ]; then
exit 0
elif [ "$ENTRY" = "$DEFAULT" ]; then
delnewsyslog
else
echo "You have changed the default munin-node entry in \"/etc/newsyslog.conf\"".
echo "If you deinstall munin-node permanently, you have to manually remove it"
fi
}
case $2 in
DEINSTALL)
if [ -z "${PACKAGE_BUILDING}" ]; then
stop_process
newsyslog
fi
;;
POST-DEINSTALL)
;;
esac