<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to apccontrol</title><link>https://sourceforge.net/p/apcctrl/wiki/apccontrol/</link><description>Recent changes to apccontrol</description><atom:link href="https://sourceforge.net/p/apcctrl/wiki/apccontrol/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 04 Apr 2016 19:01:38 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/apcctrl/wiki/apccontrol/feed" rel="self" type="application/rss+xml"/><item><title>apccontrol modified by Wagner Popov dos Santos</title><link>https://sourceforge.net/p/apcupsd-brazil/wiki/apccontrol/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="exemplo-do-arquivo-de-controle-dos-eventos-gerados-pelo-apcupsd"&gt;Exemplo do arquivo de controle dos eventos gerados pelo apcupsd&lt;/h1&gt;
&lt;p&gt;/etc/apcupsd/apccontrol:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;#!/bin/bash
#
# /etc/apcupsd/apccontrol
#
# Copyright (C) 1999-2002 Riccardo Facchetti &amp;lt;riccardo@master.oasi.gpa.it&amp;gt;
#
#  for apcupsd release 3.14.13 (02 February 2015) - debian
#
# platforms/apccontrol.  Generated from apccontrol.in by configure.
#
#  Note, this is a generic file that can be used by most
#   systems. If a particular system needs to have something
#   special, start with this file, and put a copy in the
#   platform subdirectory.
#

#
# These variables are needed for set up the autoconf other variables.
#

#exec &amp;gt;&amp;gt;/var/log/apccontrol.log 1&amp;gt;&amp;gt;/var/log/apccontrol.log 2&amp;gt;&amp;gt;/var/log/apccontrol.log 

prefi=/usr
exec_prefix=${prefix}

APCPID=/var/run/apcupsd.pid
APCUPSD=/sbin/apcupsd
SHUTDOWN=/sbin/shutdown
HIBERNATE=/usr/sbin/pm-hibernate
SCRIPTSHELL=/bin/sh
SCRIPTDIR=/etc/apcupsd
KILLALL=/usr/bin/killall
WALL=wall

export SYSADMIN=root
export APCUPSD_MAIL="/usr/sbin/ssmtp"

#
# Concatenate all output from this script to the events file
#  Note, the following kills the script in a power fail situation
#   where the disks are mounted read-only.
# exec &amp;gt;&amp;gt;/var/log/apcupsd.events 2&amp;gt;&amp;amp;1

#
# This piece is to substitute the default behaviour with your own script,
# perl, or C program.
# You can customize every single command creating an executable file (may be a
# script or a compiled program) and calling it the same as the $1 parameter
# passed by apcupsd to this script.
#
# After executing your script, apccontrol continues with the default action.
# If you do not want apccontrol to continue, exit your script with exit 
# code 99. E.g. "exit 99".
#
# WARNING: the apccontrol file will be overwritten every time you update your
# apcupsd, doing `make install'. Your own customized scripts will _not_ be
# overwritten. If you wish to make changes to this file (discouraged), you
# should change apccontrol.sh.in and then rerun the configure process.
#
if [ -f ${SCRIPTDIR}/${1} -a -x ${SCRIPTDIR}/${1} ]
then
    ${SCRIPTDIR}/${1} ${2} ${3} ${4}
fi

case "$1" in
    killpower)
    echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}" | ${WALL}
    sleep 5
    ${APCUPSD} -d 100 --killpower
    echo "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}" | ${WALL}
    ;;
    commfailure)
    echo "Warning communications lost with UPS ${2}" | ${WALL}
    ;;
    commok)
    echo "Communications restored with UPS ${2}" | ${WALL}
    ;;
    powerout)
    ;;
    onbattery)
    echo "Power failure on UPS ${2}. Running on batteries." | ${WALL}
    ;;
    offbattery)
    echo "Power has returned on UPS ${2}..." | ${WALL}
    ;;
    mainsback)
    echo "Mains back on UPS ${2}..." | ${WALL}
    ;;
    failing)
    echo "Battery power exhausted on UPS ${2}. Doing shutdown." | ${WALL}
    ;;
    timeout)
    echo "Battery time limit exceeded on UPS ${2}. Doing shutdown." | ${WALL}
    ;;
    loadlimit)
    echo "Remaining battery charge below limit on UPS ${2}. Doing shutdown." | ${WALL}
    ;;
    runlimit)
    echo "Remaining battery runtime below limit on UPS ${2}. Doing shutdown." | ${WALL}
    ;;
    doreboot)
    echo "UPS ${2} initiating Reboot Sequence" | ${WALL}
    ${SHUTDOWN} -r now &amp;amp;
    ;;
    doshutdown)
    echo "UPS ${2} initiated shutdown Sequence" | ${WALL}
    ${SHUTDOWN} -h now &amp;amp;
    ;;
    annoyme)
    echo "Power problems with UPS ${2}. Please logoff." | ${WALL}
    ;;
    emergency)
    echo "Emergency Shutdown. Possible battery failure on UPS ${2}." | ${WALL}
    ;;
    changeme)
    echo "Emergency! Batteries have failed on UPS ${2}. Change them NOW" | ${WALL}
    ;;
    remotedown)
    echo "Remote Shutdown. Beginning Shutdown Sequence." | ${WALL}
    ;;
    startselftest)
    ;;
    endselftest)
    ;;
    battdetach)
    ;;
    battattach)
    ;;
    *)  echo "Usage: ${0##*/} command" | ${WALL}
    echo "       warning: this script is intended to be launched by" | ${WALL}
    echo "       apcupsd and should never be launched by users." | ${WALL}
    ;;
esac
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Wagner Popov dos Santos</dc:creator><pubDate>Mon, 04 Apr 2016 19:01:38 -0000</pubDate><guid>https://sourceforge.net598863282dc7c236d60a6e5092c4b3fd7b8b87c7</guid></item></channel></rss>