clean up pkg-install a bit to avoid generating an error when

/etc/periodic.conf doesn't exist ...

Submitted by:	Paul Dekkers <Paul.Dekkers@surfnet.nl>
This commit is contained in:
Marc G. Fournier 2006-11-05 18:56:10 +00:00
parent cca2141326
commit 802c78e1e2
2 changed files with 14 additions and 2 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= bsdstats
PORTVERSION= 4.8
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils
DISTFILES=

View file

@ -33,7 +33,19 @@ yesno() {
}
if [ ":$2" = ":POST-INSTALL" ]; then
if [ `grep monthly_statistics /etc/periodic.conf | wc -l` = 0 ]; then
if [ -f "/etc/periodic.conf" ]; then
if [ `grep monthly_statistics /etc/periodic.conf | wc -l` = 0 ]; then
if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then
echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf
if yesno "Would you like to send a list of installed hardware as well" n; then
echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf
fi
if yesno "Would you like to run it now" y; then
/usr/local/etc/periodic/monthly/300.statistics
fi
fi
fi
elif [ ! -f "/etc/periodic.conf" ]; then
if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then
echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf
if yesno "Would you like to send a list of installed hardware as well" n; then