add mutella (thanks to olli)
[openwrt/svn-archive/archive.git] / utils / rrdcollect / files / rrdcollect.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=98
5 BIN=rrdcollect
6 DEFAULT=/etc/default/$BIN
7 RUN_D=/var/run
8 PID_F=$RUN_D/$BIN.pid
9 LIB_D=/var/lib/rrdcollect
10 CGI_S=$LIB_D/rrd.cgi
11 IMG_D=$LIB_D/img
12 RRD_D=$LIB_D/rrd
13
14 start() {
15 RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
16 [ -f $DEFAULT ] && . $DEFAULT
17 mkdir -p $RUN_D
18 mkdir -p $IMG_D
19 mkdir -p $RRD_D
20 [ -n "$RRD_F" ] || /usr/bin/rrd.sh init
21 [ -x $CGI_S ] || /usr/bin/rrd.sh cgi
22 $BIN $OPTIONS
23 }
24
25 stop() {
26 [ -f $PID_F ] && kill $(cat $PID_F)
27 }
28