diff options
Diffstat (limited to 'openwrt/package/collectd/files/S80collectd')
-rwxr-xr-x | openwrt/package/collectd/files/S80collectd | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/openwrt/package/collectd/files/S80collectd b/openwrt/package/collectd/files/S80collectd new file mode 100755 index 0000000000..aa767fbc48 --- /dev/null +++ b/openwrt/package/collectd/files/S80collectd @@ -0,0 +1,17 @@ +#!/bin/sh + +BINARY="/usr/sbin/collectd" +PIDFILE="/var/run/collectd.pid" +DATADIR="/var/lib/collectd" + +[ -x "$BINARY" ] || exit 1; + +if [ -e "$PIDFILE" ] +then + kill $(cat "$PIDFILE") 2>/dev/null + sleep 1 +fi + +[ -d "$DATADIR" ] || mkdir -p "$DATADIR"; + +$BINARY |