aboutsummaryrefslogtreecommitdiffstats
path: root/config/rate/rate.inc
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2009-06-13 22:58:40 -0400
committerjim-p <jim@pingle.org>2009-06-13 22:59:37 -0400
commit866e8caab3c18c5a65bb428521db378e198f4c9a (patch)
treef1ce54ad970da4e1e4e523554ab8c4e10de97930 /config/rate/rate.inc
parent81065c240f0e0f2b05b77bd49eb69b152b4105a9 (diff)
downloadpfsense-packages-866e8caab3c18c5a65bb428521db378e198f4c9a.tar.gz
pfsense-packages-866e8caab3c18c5a65bb428521db378e198f4c9a.tar.bz2
pfsense-packages-866e8caab3c18c5a65bb428521db378e198f4c9a.zip
Add rate package, courtesy of Scott Dale
Diffstat (limited to 'config/rate/rate.inc')
-rw-r--r--config/rate/rate.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/rate/rate.inc b/config/rate/rate.inc
new file mode 100644
index 00000000..3a2f13a9
--- /dev/null
+++ b/config/rate/rate.inc
@@ -0,0 +1,29 @@
+<?php
+
+function rate_install() {
+ global $g, $config;
+
+ /* Copy files for backup. */
+ mwexec("cp /usr/local/www/status_graph.php /usr/local/www/status_graph.php.orig");
+ unlink("/usr/local/www/status_graph.php");
+ mwexec("cp /usr/local/pkg/bandwidth_by_ip.php /usr/local/www/bandwidth_by_ip.php");
+ mwexec("cp /usr/local/pkg/status_graph.php /usr/local/www/status_graph.php");
+
+ assign_privs();
+ /* Clear the APC cache so that the updates to installed files will work. */
+ apc_clear_cache();
+}
+
+function rate_deinstall() {
+ unlink("/usr/local/www/status_graph.php");
+ unlink("/usr/local/www/bandwidth_by_ip.php");
+ mwexec("cp /usr/local/www/status_graph.php.orig /usr/local/www/status_graph.php");
+}
+
+function assign_privs() {
+ /* Fix permissions on replaced files */
+ mwexec("chown root:wheel /usr/local/www/bandwidth_by_ip.php");
+ mwexec("chown root:wheel /usr/local/www/status_graph.php");
+}
+
+?> \ No newline at end of file