mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-02 01:20:54 +00:00
forgot to 'cvs add' pkg-install
Submitted by: Paul Lipps <paul.lipps@gmail.com>
This commit is contained in:
parent
bd48f42cc0
commit
1f08de4978
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=172131
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= bsdstats
|
||||
PORTVERSION= 3.3
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= sysutils
|
||||
DISTFILES=
|
||||
|
||||
|
46
sysutils/bsdstats/pkg-install
Normal file
46
sysutils/bsdstats/pkg-install
Normal file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# pkg-install : based off /usr/ports/mail/courier/files/pkg-install.in
|
||||
#
|
||||
|
||||
ask() {
|
||||
local question default answer
|
||||
|
||||
question=$1
|
||||
default=$2
|
||||
if [ -z "${PACKAGE_BUILDING}" ]; then
|
||||
read -p "${question} [${default}]? " answer
|
||||
fi
|
||||
if [ -z "${answer}" ]; then
|
||||
answer=${default}
|
||||
fi
|
||||
echo ${answer}
|
||||
}
|
||||
|
||||
yesno() {
|
||||
local question default answer
|
||||
|
||||
question=$1
|
||||
default=$2
|
||||
while :; do
|
||||
answer=$(ask "${question}" "${default}")
|
||||
case "${answer}" in
|
||||
[Yy]*) return 0;;
|
||||
[Nn]*) return 1;;
|
||||
esac
|
||||
echo "Please answer yes or no."
|
||||
done
|
||||
}
|
||||
|
||||
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
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user