summaryrefslogtreecommitdiff
path: root/openwrt/rhctl/files/heartbeatclient.init
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/rhctl/files/heartbeatclient.init')
-rwxr-xr-xopenwrt/rhctl/files/heartbeatclient.init76
1 files changed, 0 insertions, 76 deletions
diff --git a/openwrt/rhctl/files/heartbeatclient.init b/openwrt/rhctl/files/heartbeatclient.init
deleted file mode 100755
index 002dfb3..0000000
--- a/openwrt/rhctl/files/heartbeatclient.init
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh /etc/rc.common
-START=72
-
-BIN=heartbeatclient
-DAEMON=/usr/bin/$BIN
-DESC=$BIN
-RUN_D=/var/run/rhctl
-PIDFILE=$RUN_D/$BIN.pid
-
-
-option_cb() {
- local varname="$1"
- local value="$2"
-
- if ! echo "$CONFIG_OPTIONS" | grep " $varname " > /dev/null; then
- CONFIG_OPTIONS="$CONFIG_OPTIONS $varname "
- fi
-}
-
-start_daemon() {
- local option
- local value
- local args=""
-
- local status="OK"
- for option in $CONFIG_OPTIONS
- do
- config_get value "$1" "$option"
- option=`echo $option | tr '_' '-'`
- if [ $option = "led" ]; then
- local led_path
- eval "led_path=\${LED_${value}}"
- if [ -z "$led_path" ]; then
- status="OK but led not found"
- else
- led_path="/sys/class/leds/$led_path/brightness"
- args="$args --led $led_path"
- fi
- elif [ -n "$value" ]; then
- args="$args --$option $value"
- fi
- done
- $DAEMON --write-pid $PIDFILE $args || status="failed"
- echo -n " ($status)"
-}
-
-get_led()
-{
- local name
- local sysfs
- config_get name $1 name
- config_get sysfs $1 sysfs
- eval LED_$name=$sysfs
-}
-
-start() {
- echo -n "Starting $DESC:"
- config_load "system"
- config_foreach get_led "led"
- config_load "rhctl"
- mkdir -p $RUN_D
- config_foreach start_daemon "heartbeatclient"
- echo "."
-}
-
-stop() {
- echo -n "Stopping $DESC:"
- if [ -f $PIDFILE ]; then
- kill `cat $PIDFILE` > /dev/null 2>&1
- rm -f $PIDFILE > /dev/null 2>&1
- echo -n " (Ok)"
- else
- echo -n " (not running)"
- fi
- echo "."
-}