Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=187530fb7daaf3e739768051614c71d6053c76c8

commit 187530fb7daaf3e739768051614c71d6053c76c8
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Fri Sep 17 11:06:33 2010 +0000

genpower-1.0.2-10-i686
*rewrite rc script

diff --git a/source/apps-extra/genpower/FrugalBuild 
b/source/apps-extra/genpower/FrugalBuild
index 7aff8e0..ca244f0 100644
--- a/source/apps-extra/genpower/FrugalBuild
+++ b/source/apps-extra/genpower/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=genpower
pkgver=1.0.2
-pkgrel=9
+pkgrel=10
pkgdesc="UPS monitoring daemon"
url="http://www.ibiblio.org/pub/linux/system/ups/!INDEX.html";
depends=('glibc>=2.8-3' 'bash')
@@ -15,7 +15,7 @@ 
source=(http://www.ibiblio.org/pub/Linux/system/ups/$pkgname-$pkgver.tar.gz \
genpowerfail-sbin.diff rc.ups ups)
sha1sums=('175c94ab731f13944ee14f990e15d07b65ca3ce7' \
'4c01b8be61cb8c0ce987c4692a6f5829310a07d6' \
-          'c8d4a45db5568591215ab8850ee537c5b5c9391a' \
+          'c421c2204473947fda116468994b09d6d0686ac4' \
'8c56f1e3366debd8f59a678703895d09b0531011')

build()
diff --git a/source/apps-extra/genpower/rc.ups 
b/source/apps-extra/genpower/rc.ups
index e8598a8..f0215de 100644
--- a/source/apps-extra/genpower/rc.ups
+++ b/source/apps-extra/genpower/rc.ups
@@ -5,15 +5,33 @@
# rc.ups for FrugalWare
# distributed under GPL License

-. /etc/rc.d/rc.functions
-
# chkconfig: 2345 98 98
# description: Monitor the UPS with genpowerd

+source /lib/initscripts/functions
+
+TEXTDOMAIN=ups
+TEXTDOMAINDIR=/lib/initscripts/messages
+actions=(restart status start stop)
+daemon=$"Monitor the UPS with genpowerd"
+
[ -e /etc/sysconfig/ups ] && . /etc/sysconfig/ups || exit 1

-if [ "$1" = "stop" ]; then
-       stop "$stopups"
+rc_start()
+{
+       start_msg
+       if [ -z "$device" ]; then
+               echo -n ": $editconfig"
+               ok 1
+       else
+               /sbin/genpowerd $device $type
+               ok $?
+       fi
+}
+
+rc_stop()
+{
+       stop_msg
# see if this is a powerfail situation:
if grep FAIL /etc/upsstatus 1> /dev/null 2> /dev/null ; then
# signal UPS to shut off the inverter:
@@ -23,17 +41,12 @@ if [ "$1" = "stop" ]; then
fi
fi
ok $?
-elif [ "$1" = "restart" ]; then
-       "$0" stop
+}
+rc_restart()
+{
+       rc_stop
sleep 1
-       "$0" start
-else # start
-       start "$startups"
-       if [ -z "$device" ]; then
-               echo -n ": $editconfig"
-               ok 1
-       else
-               /sbin/genpowerd $device $type
-               ok $?
-       fi
-fi
+       rc_start
+}
+rc_exec $1
+
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to