summaryrefslogtreecommitdiffstats
path: root/unstable/apcupsd/apcupsd-alpine.patch
diff options
context:
space:
mode:
Diffstat (limited to 'unstable/apcupsd/apcupsd-alpine.patch')
-rw-r--r--unstable/apcupsd/apcupsd-alpine.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/unstable/apcupsd/apcupsd-alpine.patch b/unstable/apcupsd/apcupsd-alpine.patch
new file mode 100644
index 000000000..3f5c6965b
--- /dev/null
+++ b/unstable/apcupsd/apcupsd-alpine.patch
@@ -0,0 +1,41 @@
+--- a/platforms/apccontrol.in Mon Oct 26 09:12:30 2009
++++ b/platforms/apccontrol.in Mon Oct 26 09:36:47 2009
+@@ -20,11 +20,20 @@
+
+ APCPID=@PIDDIR@/apcupsd.pid
+ APCUPSD=@sbindir@/apcupsd
+-SHUTDOWN=@SHUTDOWN@
++POWEROFF=/sbin/poweroff
++REBOOT=/sbin/reboot
+ SCRIPTSHELL=@SCRIPTSHELL@
+ SCRIPTDIR=@sysconfdir@
+-WALL=wall
++WALL=_wall
+
++_wall() {
++ local i
++ local msg=$(cat)
++ for i in /dev/pts/*; do
++ [ -c "$i" ] && echo "$msg" > $i
++ done
++}
++
+ #
+ # Concatenate all output from this script to the events file
+ # Note, the following kills the script in a power fail situation
+@@ -100,11 +109,13 @@
+ ;;
+ doreboot)
+ echo "UPS ${2} initiating Reboot Sequence" | ${WALL}
+- ${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot"
++ echo "apcupsd UPS ${2} initiated reboot" | ${WALL}
++ $REBOOT
+ ;;
+ doshutdown)
+ echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
+- ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
++ echo "apcupsd UPS ${2} initiated shutdown" | ${WALL}
++ $POWEROFF
+ ;;
+ annoyme)
+ echo "Power problems with UPS ${2}. Please logoff." | ${WALL}