From d69f56ee1532be5a5fb5c36cc5c6e02da4eb8636 Mon Sep 17 00:00:00 2001 From: Nicolas Thill Date: Fri, 11 Nov 2011 15:46:34 +0000 Subject: [PATCH] packages/hd-idle: use new service functions SVN-Revision: 28949 --- utils/hd-idle/Makefile | 2 +- utils/hd-idle/files/hd-idle.init | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/utils/hd-idle/Makefile b/utils/hd-idle/Makefile index a97445d4c8..1d002af5b6 100644 --- a/utils/hd-idle/Makefile +++ b/utils/hd-idle/Makefile @@ -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) diff --git a/utils/hd-idle/files/hd-idle.init b/utils/hd-idle/files/hd-idle.init index 4b091be131..581ae52031 100644 --- a/utils/hd-idle/files/hd-idle.init +++ b/utils/hd-idle/files/hd-idle.init @@ -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 } -- 2.30.2