Author: arekm
Date: Wed Mar 19 13:51:03 2008
New Revision: 9645

Modified:
   rc-scripts/trunk/rc.d/rc.shutdown
Log:
Multiple UPS support.

Modified: rc-scripts/trunk/rc.d/rc.shutdown
==============================================================================
--- rc-scripts/trunk/rc.d/rc.shutdown   (original)
+++ rc-scripts/trunk/rc.d/rc.shutdown   Wed Mar 19 13:51:03 2008
@@ -155,9 +155,17 @@
        show "The $_rebootwhat is halted"; ok
        [ -f /fastboot ] && (show "On the next boot fsck will be skipped."; ok)
 
-       if [ -x /sbin/poweroff-ups -a -f /etc/killpower -a -f 
/etc/sysconfig/ups ] ; then
+       if [ -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
                . /etc/sysconfig/ups
-               is_yes "$POWEROFF_UPS" && /sbin/poweroff-ups
+               if is_yes "$POWEROFF_UPS"; then
+                       if [ -d /etc/ups.d ]; then
+                               for i in /etc/ups.d/*; do
+                                       [ ! -f $i -o ! -x $i ] && continue
+                                       $i poweroff
+                               done
+                       fi
+                      [ -x /sbin/poweroff-ups ] && /sbin/poweroff-ups
+              fi
        fi
        [ "$previous" != "unknown" ] && eval halt -d -p
 else
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to