2007-04-22 20:09:05 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2007 OpenWrt.org
|
|
|
|
|
|
|
|
START=60
|
|
|
|
RUN_D=/var/empty
|
|
|
|
|
|
|
|
start() {
|
|
|
|
mkdir -p $RUN_D
|
2009-11-23 22:11:42 +00:00
|
|
|
include /lib/network
|
|
|
|
scan_interfaces
|
2007-04-22 20:09:05 +00:00
|
|
|
config_load darkstat
|
|
|
|
config_foreach start_darkstat darkstat
|
|
|
|
}
|
|
|
|
|
|
|
|
start_darkstat() {
|
|
|
|
local cfg="$1"
|
|
|
|
config_get interface "$cfg" interface
|
|
|
|
config_get httpaddr "$cfg" httpaddr
|
|
|
|
config_get httpport "$cfg" httpport
|
|
|
|
|
|
|
|
config_get ifname "$interface" ifname
|
2007-12-30 20:08:09 +00:00
|
|
|
|
2009-11-23 22:11:42 +00:00
|
|
|
/usr/sbin/darkstat --verbose \
|
|
|
|
-i "$ifname" \
|
2008-07-24 10:37:30 +00:00
|
|
|
${httpaddr:+-b "$httpaddr"} \
|
|
|
|
${httpport:+-p "$httpport"} \
|
|
|
|
--chroot $RUN_D
|
2007-04-22 20:09:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2009-11-23 22:11:42 +00:00
|
|
|
killall darkstat
|
2007-04-22 20:09:05 +00:00
|
|
|
}
|