From 6ed746465c2cb4eb28b8aa9a5989d2515aabfa69 Mon Sep 17 00:00:00 2001 From: nico Date: Fri, 11 Nov 2011 15:46:36 +0000 Subject: [PATCH] packages/fanctrolled: use new service functions git-svn-id: svn://svn.openwrt.org/openwrt/packages@28950 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- utils/fancontroled/Makefile | 4 ++-- utils/fancontroled/files/fancontroled.init | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/utils/fancontroled/Makefile b/utils/fancontroled/Makefile index 43e3b2e67..c30880085 100644 --- a/utils/fancontroled/Makefile +++ b/utils/fancontroled/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2010 OpenWrt.org +# Copyright (C) 2010-2011 OpenWrt.org # # This is free software, licensed under the GNU General Public License v3. # See /LICENSE for more information. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fancontroled PKG_VERSION:=0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar PKG_SOURCE_URL:=http://code.lukaperkov.net/fancontroled/ diff --git a/utils/fancontroled/files/fancontroled.init b/utils/fancontroled/files/fancontroled.init index 2ec5e8706..b87255337 100644 --- a/utils/fancontroled/files/fancontroled.init +++ b/utils/fancontroled/files/fancontroled.init @@ -3,6 +3,10 @@ START=75 STOP=75 +SERVICE_NAME="fancontroled" +SERVICE_COMMAND="/usr/sbin/$SERVICE_NAME" +SERVICE_PID_FILE="/var/run/$SERVICE_NAME.pid" + TEMP_SENSOR_CHIP=lm75 TEMP_READ_FIELD=temp1_input MIN_TEMP=30 @@ -11,12 +15,11 @@ FAN_SENSOR_CHIP=g760a FAN_CONTROL_FIELD=pwm1 PWM_FAN_MIN=1 PWM_FAN_MAX=180 -PID_FILENAME=/var/run/fancontroled.pid start() { - /usr/sbin/fancontroled -t $TEMP_SENSOR_CHIP -r $TEMP_READ_FIELD -m $MIN_TEMP -M $MAX_TEMP -f $FAN_SENSOR_CHIP -c $FAN_CONTROL_FIELD -p $PWM_FAN_MIN -P $PWM_FAN_MAX -z $PID_FILENAME + service_start $SERVICE_COMMAND -t $TEMP_SENSOR_CHIP -r $TEMP_READ_FIELD -m $MIN_TEMP -M $MAX_TEMP -f $FAN_SENSOR_CHIP -c $FAN_CONTROL_FIELD -p $PWM_FAN_MIN -P $PWM_FAN_MAX -z $SERVICE_PID_FILE } stop() { - kill $(cat $PID_FILENAME) + service_stop $SERVICE_COMMAND }