From 7efa776763e3de0c2d3d0eb87fe058a1b0f17ada Mon Sep 17 00:00:00 2001 From: Sergey Matveychuk Date: Fri, 4 Mar 2005 17:45:10 +0000 Subject: - Update to 1.2.0 - Put logfiles in /var/log/munin-main rather than /var/log - Change group of all munin-main directories to munin - Use SUB_FILES - Add log rotation support - Add @exec mkdir to pkg-plist for package installation PR: ports/77720 Submitted by: maintainer --- sysutils/munin-master/pkg-deinstall | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'sysutils/munin-master/pkg-deinstall') diff --git a/sysutils/munin-master/pkg-deinstall b/sysutils/munin-master/pkg-deinstall index 261b7b15a8b3..200d96a2a617 100644 --- a/sysutils/munin-master/pkg-deinstall +++ b/sysutils/munin-master/pkg-deinstall @@ -1,7 +1,4 @@ #! /bin/sh -# -# $Log$ -# ask() { local question default answer @@ -80,15 +77,38 @@ delete_crontab_entries() { echo "These are the remaining lines:" crontab -u munin -l else - crontab -u munin -r + echo y | crontab -u munin -r echo "crontab for user munin removed" fi rm $TMPFILE } +delnewsyslog() { + tmp="/etc/#munin-node$$" + sed -e '/^\/var\/log\/munin-main\/\*\.log[ ]/d' /etc/newsyslog.conf >${tmp} + cat ${tmp} > /etc/newsyslog.conf + rm ${tmp} +} + +newsyslog() { + ENTRY=`fgrep '/var/log/munin-main/*' /etc/newsyslog.conf` + DEFAULT='/var/log/munin-main/*.log munin:munin 644 7 * @T00 GNWZ' + if [ -z "$ENTRY" ]; then + exit 0 + elif [ "$ENTRY" = "$DEFAULT" ]; then + delnewsyslog + elif yesno "You have changed the default munin-main entry in \"/etc/newsyslog.conf\". +Do you want me to delete it?" y; then + delnewsyslog + echo "Done." + fi +} + + case $2 in DEINSTALL) - delete_crontab_entries '#BEGIN_MUNIN' '#END_MUNIN' + delete_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' + newsyslog ;; POST-DEINSTALL) delete_account munin munin -- cgit v1.3