#!/bin/sh /etc/rc.common
-# Copyright (C) 2008 OpenWrt.org
-START=50
+# Copyright (C) 2008-2011 OpenWrt.org
-SSD=start-stop-daemon
-NAME=hd-idle
-PROG=/usr/bin/$NAME
+START=50
append_bool() {
local section="$1"
append_string "$section" "disk" "-t"
append_bool "$section" "enable_debug" "-d"
config_get_bool "enabled" "$section" "enabled" '1'
- [ "$enabled" -gt 0 ] && $SSD -S -q -x $PROG -- "-i $(compute_seconds $interval $unit) $args"
-}
-
-stop_service() {
- $SSD -K -q -x $PROG
+ [ "$enabled" -gt 0 ] || return 1
+ service_start /usr/bin/hd-idle -i "$(compute_seconds $interval $unit)" $args
}
start() {
}
stop() {
- config_load "hd-idle"
- config_foreach stop_service "hd-idle"
+ service_start /usr/bin/hd-idle
}