aboutsummaryrefslogtreecommitdiffstats
path: root/config/ifbwstats/ifbwstats.sh
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-10-20 18:37:48 -0400
committerjim-p <jimp@pfsense.org>2010-10-20 18:37:48 -0400
commit41681e0a817aaabf930357543bde94c838d0c40b (patch)
treef1279459af96282aab838466c222cc476d4b2eba /config/ifbwstats/ifbwstats.sh
parentce9654bdb28fe7c6cec42097774e56aa6c4eeb41 (diff)
downloadpfsense-packages-41681e0a817aaabf930357543bde94c838d0c40b.tar.gz
pfsense-packages-41681e0a817aaabf930357543bde94c838d0c40b.tar.bz2
pfsense-packages-41681e0a817aaabf930357543bde94c838d0c40b.zip
Add contributed ifbwstats package from Zorac on the forum.
Diffstat (limited to 'config/ifbwstats/ifbwstats.sh')
-rw-r--r--config/ifbwstats/ifbwstats.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/config/ifbwstats/ifbwstats.sh b/config/ifbwstats/ifbwstats.sh
new file mode 100644
index 00000000..fb7ea4fd
--- /dev/null
+++ b/config/ifbwstats/ifbwstats.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. /etc/rc.subr
+
+name="ifbwstats"
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+restart_cmd="${name}_restart"
+
+# called by pfSense by rc.start_packages on startup
+ifbwstats_start()
+{
+# ifBWStats: initialize ifbwstats_daemon.php script
+/usr/local/bin/php -q /usr/local/www/ifbwstats_daemon.php & 2>/dev/null
+}
+
+ifbwstats_stop()
+{
+################################################################
+# pfSense does not call rc.stop_packages so this is not called
+################################################################
+kill -INT `cat /var/run/ifbwstats.lock`
+}
+
+ifbwstats_restart()
+{
+kill -INT `cat /var/run/ifbwstats.lock`
+sleep 2
+/usr/local/bin/php -q /usr/local/www/ifbwstats_daemon.php & 2>/dev/null
+}
+
+load_rc_config $name
+run_rc_command "$1" \ No newline at end of file