summaryrefslogtreecommitdiffstats
path: root/openwrt/package/collectd/files/S80collectd
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-29 15:09:37 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-12-29 15:09:37 +0000
commited1ee897100c57f389499656cd9114fc936796a2 (patch)
treee048ec92275d3ef9c0b0b64ba0460a25945b99fd /openwrt/package/collectd/files/S80collectd
parent9ff4789defdfffe204015aa792fe199274d931d1 (diff)
Added collectd, thanks to Florian Forster
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2796 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/collectd/files/S80collectd')
-rwxr-xr-xopenwrt/package/collectd/files/S80collectd17
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 000000000..aa767fbc4
--- /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