BSDStats
bsdstats
0.1
system("/bin/mkdir -p /usr/local/etc/periodic/monthly/");
system("/usr/bin/fetch -q -o /usr/local/etc/periodic/monthly/ http://www.bsdstats.org/downloads/300.statistics");
system("/bin/chmod a+rx /usr/local/etc/periodic/monthly/300.statistics");
if(!is_file("/usr/local/etc/periodic/monthly/300.statistics") {
update_status("Could not fetch 300.statistics from bsdstats.org");
update_output_window("Install failed. Please check dns, etc");
exit;
}
system("echo monthly_statistics_report_devices=yes >> /etc/periodic.conf");
system("echo monthly_statistics_enable=yes >> /etc/periodic.conf");
system("/usr/local/etc/periodic/monthly/300.statistics");
$getid=file_get_contents("/tmp/getid");
log_error("Thanks for installing BSDStats. Your id is {$getid}.");
system("cat /etc/periodic.conf | grep -n \"monthly_statistics_report_devices\" >/tmp/periodic.conf");
system("cat /tmp/periodic.conf | grep -n \"monthly_statistics_enable\" >/etc/periodic.conf");
system("rm /usr/local/etc/periodic/monthly/300.statistics");
system("rm /tmp/periodic.conf");
system("rm /tmp/getid");