packages/hd-idle: use new service functions
authorNicolas Thill <nico@openwrt.org>
Fri, 11 Nov 2011 15:46:34 +0000 (15:46 +0000)
committerNicolas Thill <nico@openwrt.org>
Fri, 11 Nov 2011 15:46:34 +0000 (15:46 +0000)
SVN-Revision: 28949

utils/hd-idle/Makefile
utils/hd-idle/files/hd-idle.init

index a97445d..1d002af 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hd-idle
 PKG_VERSION:=1.03
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
index 4b091be..581ae52 100644 (file)
@@ -1,10 +1,7 @@
 #!/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"
@@ -69,11 +66,8 @@ start_service() {
        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() {
@@ -82,6 +76,5 @@ start() {
 }
 
 stop() {
-       config_load "hd-idle"
-       config_foreach stop_service "hd-idle"
+       service_start /usr/bin/hd-idle
 }