From 2c3513c52e256e5b7a4e42d0ebc2119645e6585a Mon Sep 17 00:00:00 2001 From: scrappy Date: Sat, 28 Apr 2007 19:12:31 +0000 Subject: By popular request, I've added a bsdstats.sh script to etc/rc.d so that it can be enabled to run on reboot (ie. for laptops, office computers, etc) since not everyone runs a server 24/7 ... I've added to pkg-install a yesno question as to whether it should be enabled on reboot, seperate from the monthly periodic run ... --- sysutils/bsdstats/Makefile | 6 ++++-- sysutils/bsdstats/pkg-install | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'sysutils/bsdstats') diff --git a/sysutils/bsdstats/Makefile b/sysutils/bsdstats/Makefile index ab3f99263cdd..11924b9952fb 100644 --- a/sysutils/bsdstats/Makefile +++ b/sysutils/bsdstats/Makefile @@ -7,7 +7,7 @@ PORTNAME= bsdstats PORTVERSION= 5.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils DISTFILES= @@ -21,13 +21,15 @@ RUN_DEPENDS= nc:${PORTSDIR}/net/netcat .endif NO_BUILD= yes -PLIST_FILES= etc/periodic/monthly/300.statistics +PLIST_FILES= etc/periodic/monthly/300.statistics etc/rc.d/bsdstats.sh PLIST_DIRS= etc/periodic/monthly \ etc/periodic do-install: ${MKDIR} ${LOCALBASE}/etc/periodic/monthly ${CP} ${FILESDIR}/300.statistics ${LOCALBASE}/etc/periodic/monthly + ${CP} ${FILESDIR}/bsdstats.sh ${LOCALBASE}/etc/rc.d + ${CHMOD} 0755 ${LOCALBASE}/etc/rc.d/bsdstats.sh post-install: ${CAT} ${PKGMESSAGE} .if defined(BATCH) || defined(PACKAGE_BUILDING) diff --git a/sysutils/bsdstats/pkg-install b/sysutils/bsdstats/pkg-install index 0d667932620e..487c4a3e51f9 100644 --- a/sysutils/bsdstats/pkg-install +++ b/sysutils/bsdstats/pkg-install @@ -62,5 +62,16 @@ if [ ":$2" = ":POST-INSTALL" ]; then fi fi fi + if [ -f "/etc/rc.conf" ]; then + if [ `grep bsdstats_enable /etc/rc.conf | wc -l` = 0 ]; then + if yesno "Would you like to activate reporting on reboot in /etc/rc.conf" n; then + echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf + fi + fi + elif [ ! -f "/etc/periodic.conf" ]; then + if yesno "Would you like to activate reporting on reboot in /etc/rc.conf" n; then + echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf + fi + fi fi -- cgit