#!/bin/bash
#
# This script if placed in /etc/apcupsd
# will be called only once manualy for generate 
# symlinks to upsdmessages script
# This symlinks will be called by /etc/apcupsd/apccontrol 
# when the UPS goes on batteries.
#

for f in changeme commfailure commok masterconnect mastertimeout offbattery onbattery
do
    [ -f $f ] && ( rm -f $f && ln -s upsdmessages $f )
done
