aboutsummaryrefslogtreecommitdiffstats
path: root/main/apcupsd/apcupsd-alpine.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-10-26 13:56:44 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-10-26 13:56:44 +0000
commit891dd883d12e1b22e0abb8a0163fc08584203159 (patch)
tree3bf4ccb1ca1de24e0348e00ef4ef48512e8d94ea /main/apcupsd/apcupsd-alpine.patch
parentb135457ff0ba0eda52c9808f767a2a30013cc9ac (diff)
downloadaports-891dd883d12e1b22e0abb8a0163fc08584203159.tar.bz2
aports-891dd883d12e1b22e0abb8a0163fc08584203159.tar.xz
main/apcupsd: moved from testing
Diffstat (limited to 'main/apcupsd/apcupsd-alpine.patch')
-rw-r--r--main/apcupsd/apcupsd-alpine.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/apcupsd/apcupsd-alpine.patch b/main/apcupsd/apcupsd-alpine.patch
new file mode 100644
index 0000000000..3f5c6965b7
--- /dev/null
+++ b/main/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}