2006-10-04 21:04:48 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
2006-08-07 16:56:51 +00:00
|
|
|
|
2006-10-15 21:03:30 +00:00
|
|
|
START=98
|
2006-08-07 16:56:51 +00:00
|
|
|
BIN=rrdcollect
|
|
|
|
DEFAULT=/etc/default/$BIN
|
|
|
|
RUN_D=/var/run
|
|
|
|
PID_F=$RUN_D/$BIN.pid
|
|
|
|
LIB_D=/var/lib/rrdcollect
|
|
|
|
CGI_S=$LIB_D/rrd.cgi
|
|
|
|
IMG_D=$LIB_D/img
|
|
|
|
RRD_D=$LIB_D/rrd
|
|
|
|
|
2006-10-04 21:04:48 +00:00
|
|
|
start() {
|
2006-10-15 21:03:30 +00:00
|
|
|
RRD_F=$(find $RRD_D -name "*.rrd" 2>/dev/null)
|
|
|
|
[ -f $DEFAULT ] && . $DEFAULT
|
2006-10-04 21:04:48 +00:00
|
|
|
mkdir -p $RUN_D
|
|
|
|
mkdir -p $IMG_D
|
|
|
|
mkdir -p $RRD_D
|
|
|
|
[ -n "$RRD_F" ] || /usr/bin/rrd.sh init
|
|
|
|
[ -x $CGI_S ] || /usr/bin/rrd.sh cgi
|
|
|
|
$BIN $OPTIONS
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
[ -f $PID_F ] && kill $(cat $PID_F)
|
|
|
|
}
|
2006-08-07 16:56:51 +00:00
|
|
|
|