From 5c9665a0706cd9de96a2e49f8ad3102a37acd36f Mon Sep 17 00:00:00 2001 From: Jean-Michel Lacroix Date: Sun, 1 Jan 2017 12:44:56 -0500 Subject: bandwidthd: update to 2.0.1-34, sqlite support and SMTP tracking Addition of sqlite storage Tracking of SMTP traffic instead of P2P traffic Based on NethServer bandwidthd implementation Signed-off-by: Jean-Michel lacroix --- utils/bandwidthd/files/bandwidthd-php.init | 75 ++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100755 utils/bandwidthd/files/bandwidthd-php.init (limited to 'utils/bandwidthd/files/bandwidthd-php.init') diff --git a/utils/bandwidthd/files/bandwidthd-php.init b/utils/bandwidthd/files/bandwidthd-php.init new file mode 100755 index 000000000..b7b6434f0 --- /dev/null +++ b/utils/bandwidthd/files/bandwidthd-php.init @@ -0,0 +1,75 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2017 OpenWrt.org + +START=99 + +USE_PROCD=1 + +CONFIGNAME="bandwidthd-php" +CONFIGFILE="/var/etc/bandwidthd-php.conf" + +config_cb() { + local cfg_type="$1" + local cfg_name="$2" + case "$cfg_type" in + $CONFIGNAME) + append cfgs "$cfg_name" + ;; + esac +} + +export_number() { + local option="$1" + local section="$2" + local _loctmp + paramstr="" + config_get _loctmp "$section" "$option" + if [ -n "$_loctmp" ]; then + paramstr="${_loctmp}" + fi +} + +export_string() { + local option="$1" + local section="$2" + local _loctmp + paramstr="" + config_get _loctmp "$section" "$option" + if [ -n "$_loctmp" ]; then + paramstr="${_loctmp}" + fi +} + +service_triggers() +{ + procd_add_reload_trigger $CONFIGNAME +} + + +start_service() { + local conffile="" + [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGFILE + done +} -- cgit v1.2.3