packages/hd-idle: use new service functions

git-svn-id: svn://svn.openwrt.org/openwrt/packages@28949 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nico 2011-11-11 15:46:34 +00:00
parent c631721351
commit 5a3b6f1ef6
2 changed files with 6 additions and 13 deletions

View 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)

View 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
}