an easy and consistent way of installing software ported to FreeBSD
The purpose of this port is to attempt to produce reasonably accurate
statistics on FreeBSD deployment, to be used for both marketing, and
advocacy purposes by the project.
The major problem that we are trying to address is vendors who do not
feel that FreeBSD presents enough of a market to bother supporting.
WWW: http://bsdstats.hub.org
#!/bin/sh
#
# pkg-install : based off ${PORTSDIR}/mail/courier/files/pkg-install.in
#
LOCALBASE=${LOCALBASE:=/usr/local}
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 [ -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 send a list of installed ports as well" n; then
echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf
fi
if yesno "Would you like to run it now" y; then
${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay
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
echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf
fi
if yesno "Would you like to send a list of installed ports as well" n; then
echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf
fi
if yesno "Would you like to run it now" y; then
${PKG_PREFIX}/etc/periodic/monthly/300.statistics -nodelay
fi
fi
fi
if [ -f "/etc/rc.conf" ]; then
if [ `grep bsdstats_enable /etc/rc.conf | wc -l` = 0 ]; then
echo ""
echo "If running as a desktop, or on a laptop, it is recommended that you"
echo "enable bsdstats within /etc/rc.conf, so that it will run on reboot."
echo ""
echo "This will ensure that even if your computer is off when monthly runs,"
echo "your computer will be properly counted."
echo ""
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/rc.conf" ]; then
echo ""
echo "If running as a desktop, or on a laptop, it is recommended that you"
echo "enable bsdstats within /etc/rc.conf, so that it will run on reboot."
echo ""
echo "This will ensure that even if your computer is off when monthly runs,"
echo "your computer will be properly counted."
echo ""
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
This script, meant to be run monthly, submits statistics anonymously
to a central checkin server (http://bsdstats.org), in an attempt to
generate reasonably accurate demographics of both *BSD usage, as well
as devices in use.
Steps have been taken to make eliminate security concerns brought up
in earlier releases of this, including, but not limited to, not storing
anything in the database that has been deemed as 'sensitive' (ie. IP of
the reporting server, and hostname).
********************
To enable monthly reporting, edit or create /etc/periodic.conf and add this line:
monthly_statistics_enable="YES"
To enable boottime reporting, edit or create /etc/rc.conf and add this line:
bsdstats_enable="YES"
To enable device reporting, add this line:
monthly_statistics_report_devices="YES"
To enable ports reporting, add this line:
monthly_statistics_report_ports="YES"
To run it manually the first time, just run it as:
${LOCALBASE}/etc/periodic/monthly/300.statistics -nodelay
To view current statistics, go to:
http://www.bsdstats.org
********************
etc/periodic/monthly/300.statistics
etc/rc.d/bsdstats.sh
@dirrmtry etc/periodic/monthly
@dirrmtry etc/periodic