packages/net/darkstat/files/darkstat.init
florian d54f2ff92e [package] fix darkstat init script (#6005)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@18509 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-11-23 22:11:42 +00:00

33 lines
569 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
START=60
RUN_D=/var/empty
start() {
mkdir -p $RUN_D
include /lib/network
scan_interfaces
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
/usr/sbin/darkstat --verbose \
-i "$ifname" \
${httpaddr:+-b "$httpaddr"} \
${httpport:+-p "$httpport"} \
--chroot $RUN_D
}
stop() {
killall darkstat
}