UPS: apcupsd clean sources
[tomato.git] / release / src / router / apcupsd / platforms / slackware / rc6.patch.in.old
blob811febb8e23b591049a1368f6cdf2b2e7d6408db
1 --- rc.6.orig   Sat Sep 11 14:38:33 1999
2 +++ rc.6        Sun Feb 27 13:22:11 2000
3 @@ -84,11 +84,31 @@
4    # This never hurts:
5    sync
6  
7 +  # This block was from the original Slackware distribution:
8    # See if this is a powerfail situation.
9 -  if [ -f /etc/power_is_failing ]; then
10 -    echo "Turning off UPS, bye."
11 -    /sbin/powerd -q
12 -    exit 1
13 +  #if [ -f /etc/power_is_failing ]; then
14 +  #  echo "Turning off UPS, bye."
15 +  #  /sbin/powerd -q
16 +  #  exit 1
17 +  #fi
19 +  # This block was added in by the apcupsd installation process.  This
20 +  # will cause the UPS to kill the power supply after a configurable number
21 +  # of seconds (see the apcupsd.conf file).  This is important for situations
22 +  # where the mains power comes back before the UPS batteries are completely
23 +  # dead.
24 +  if [ -f @PWRFAILDIR@/powerfail ]; then
25 +    echo
26 +    echo "apcupsd will now power off the UPS"
27 +    echo
28 +    @sysconfdir@/apccontrol killpower
29 +    echo
30 +    echo "Please ensure that the UPS has powered off before rebooting."
31 +    echo "Otherwise, the UPS may cut the power during the reboot."
32 +    echo
33 +    halt -f -p         # power down the system if the hardware is capable
34    fi
36    # Now halt (poweroff with APM kernels) or reboot.