Lines 6-18
Link Here
|
6 |
# |
6 |
# |
7 |
# Environment Variable | Question |
7 |
# Environment Variable | Question |
8 |
# --------------------------+------------------------------------------------------------------ |
8 |
# --------------------------+------------------------------------------------------------------ |
|
|
9 |
# BSDSTATS_MONTHLY_ENABLE | Would you like to enable monthly reporting in /etc/periodic.conf? |
10 |
# BSDSTATS_MONTHLY_DEVICES | Would you like to send a list of installed hardware as well? |
11 |
# BSDSTATS_MONTHLY_PORTS | Would you like to send a list of installed ports as well? |
9 |
# BSDSTATS_MONTHLY_NOW | Would you like to run it now? |
12 |
# BSDSTATS_MONTHLY_NOW | Would you like to run it now? |
10 |
# BSDSTATS_REBOOT_REPORTING | Would you like to enable reporting on bootup in /etc/rc.conf? |
13 |
# BSDSTATS_REBOOT_REPORTING | Would you like to enable reporting on bootup in /etc/rc.conf? |
11 |
|
14 |
|
12 |
if [ -n "$PACKAGE_BUILDING" ]; then |
15 |
if [ -n "$PACKAGE_BUILDING" ]; then |
|
|
16 |
BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=no} |
17 |
BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=no} |
18 |
BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=no} |
13 |
BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=no} |
19 |
BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=no} |
14 |
BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=no} |
20 |
BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=no} |
15 |
else |
21 |
else |
|
|
22 |
BSDSTATS_MONTHLY_ENABLE=${BSDSTATS_MONTHLY_ENABLE:=yes} |
23 |
BSDSTATS_MONTHLY_DEVICES=${BSDSTATS_MONTHLY_DEVICES:=yes} |
24 |
BSDSTATS_MONTHLY_PORTS=${BSDSTATS_MONTHLY_PORTS:=yes} |
16 |
BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=yes} |
25 |
BSDSTATS_MONTHLY_NOW=${BSDSTATS_MONTHLY_NOW:=yes} |
17 |
BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=yes} |
26 |
BSDSTATS_REBOOT_REPORTING=${BSDSTATS_REBOOT_REPORTING:=yes} |
18 |
fi |
27 |
fi |
Lines 47-62
Link Here
|
47 |
} |
56 |
} |
48 |
|
57 |
|
49 |
if [ "$2" = "POST-INSTALL" ]; then |
58 |
if [ "$2" = "POST-INSTALL" ]; then |
50 |
log_file="${INSTALL_PREFIX}/var/log/bsdstats" |
59 |
if [ ! -f "/etc/periodic.conf" ] || [ -z $(grep monthly_statistics /etc/periodic.conf) ]; then |
51 |
need_to_ask=0 |
60 |
if yesno "Would you like to enable monthly reporting in /etc/periodic.conf" $BSDSTATS_MONTHLY_ENABLE; then |
52 |
if [ ! -e ${log_file} ]; then |
61 |
echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf |
53 |
need_to_ask=1 |
62 |
if yesno "Would you like to send a list of installed hardware as well" $BSDSTATS_MONTHLY_DEVICES; then |
54 |
elif [ $(($(date +"%s")-$(stat -f %Sm -t %s ${log_file}))) -gt $((60*60*24*40)) ]; then |
63 |
echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf |
55 |
need_to_ask=1 |
64 |
fi |
56 |
fi |
65 |
if yesno "Would you like to send a list of installed ports as well" $BSDSTATS_MONTHLY_PORTS; then |
57 |
if [ $need_to_ask = 1 ]; then |
66 |
echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf |
58 |
if yesno "Would you like to run BSDstats now" $BSDSTATS_MONTHLY_NOW; then |
67 |
fi |
59 |
${INSTALL_PREFIX}${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay |
68 |
if yesno "Would you like to run it now" $BSDSTATS_MONTHLY_NOW; then |
|
|
69 |
if [ -z "$PACKAGE_BUILDING" ]; then |
70 |
${3}/etc/periodic/monthly/300.statistics -nodelay |
71 |
else |
72 |
${INSTALL_PREFIX}${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay |
73 |
fi |
74 |
fi |
60 |
fi |
75 |
fi |
61 |
fi |
76 |
fi |
62 |
if [ ! -f "/etc/rc.conf" ] || [ -z $(grep bsdstats_enable /etc/rc.conf) ]; then |
77 |
if [ ! -f "/etc/rc.conf" ] || [ -z $(grep bsdstats_enable /etc/rc.conf) ]; then |