d58201b8d5
* Add restart() function to the init script * Add a config file * Cleanup Makefile * Update: 3.5.1 > 3.11.5 git-svn-id: svn://svn.openwrt.org/openwrt/packages@7980 3c298f89-4303-0410-b956-a3cf2f4a3e73
30 lines
402 B
Bash
Executable File
30 lines
402 B
Bash
Executable File
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
START=80
|
|
BINARY="/usr/sbin/collectd"
|
|
PIDFILE="/var/run/collectd.pid"
|
|
DATADIR="/var/lib/collectd"
|
|
|
|
start() {
|
|
[ -x "$BINARY" ] || exit 1;
|
|
|
|
if [ -e "$PIDFILE" ]
|
|
then
|
|
kill $(cat "$PIDFILE") 2>/dev/null
|
|
sleep 1
|
|
fi
|
|
|
|
[ -d "$DATADIR" ] || mkdir -p "$DATADIR";
|
|
|
|
$BINARY
|
|
}
|
|
|
|
stop() {
|
|
kill $(cat "$PIDFILE") 2>/dev/null
|
|
}
|
|
|
|
restart() {
|
|
start
|
|
}
|