Make pkg-install a bit smarter ... if the questions have already been

answered in /etc/periodic.conf, don't ask them again, just print
out the message ...

Better for unattended port upgrades ...
This commit is contained in:
Marc G. Fournier 2006-10-08 00:39:29 +00:00
parent dc37b8e043
commit d116ebec62
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=174882
2 changed files with 10 additions and 7 deletions

View file

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

View file

@ -33,13 +33,15 @@ yesno() {
}
if [ ":$2" = ":POST-INSTALL" ]; 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
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
fi