2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
2006-08-01 11:52:57 +00:00
|
|
|
|
2006-10-15 21:03:30 +00:00
|
|
|
START=80
|
2006-08-01 11:52:57 +00:00
|
|
|
BINARY="/usr/sbin/collectd"
|
|
|
|
PIDFILE="/var/run/collectd.pid"
|
|
|
|
DATADIR="/var/lib/collectd"
|
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
|
|
|
[ -x "$BINARY" ] || exit 1;
|
2006-08-01 11:52:57 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
if [ -e "$PIDFILE" ]
|
|
|
|
then
|
|
|
|
kill $(cat "$PIDFILE") 2>/dev/null
|
|
|
|
sleep 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ -d "$DATADIR" ] || mkdir -p "$DATADIR";
|
2006-08-01 11:52:57 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
$BINARY
|
|
|
|
}
|
2006-08-01 11:52:57 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
stop() {
|
|
|
|
kill $(cat "$PIDFILE") 2>/dev/null
|
|
|
|
}
|