#!/bin/sh # apcupsd halt script # by Martin Mitchell # modifications by Gordon Morehouse April 2001 case "$1" in poweroff | killpower) if [ -f /var/log/powerfail ]; then echo "" echo -n "apcupsd: Ordering UPS to kill power... " /usr/local/bin/apccontrol killpower echo "done." echo "" echo "Please ensure the UPS has powered off before rebooting." echo "Otherwise, the UPS may cut the power during the reboot!" echo "" sleep 2d fi ;; *) ;; esac exit 0