#!/bin/bash #DESC Install the APC UPS Daemon. cd /tmp #[ ! -f ./apcupsd-3.14.14-18.el8.x86_64.rpm ] && wget -q http://rhel8repo.centralus.cloudapp.azure.com/support/apcupsd-3.14.14-18.el8.x86_64.rpm [ ! -f ./apcupsd-3.14.10-1.x86_64.rpm ] && wget -q http://rhel8repo.centralus.cloudapp.azure.com/support/apcupsd-3.14.10-1.x86_64.rpm yum -y localinstall ./apcupsd-3.14.10-1.x86_64.rpm /usr2/ostools/bin/updateos.pl --ups [ -f /usr2/upgrade/apcupsd.conf ] && cp -f /usr2/upgrade/apcupsd.conf /etc/apcupsd/apcupsd.conf [ "`grep RTIUPS /etc/apcupsd/apcupsd.conf`" == "" ] && cat > /etc/apcupsd/apcupsd.conf << EOF ## apcupsd.conf v1.1 ## # # APC UPS Config File # Generated by updateos.pl $Revision: 1.347 $ 20201210210241 # Serial Based Interface UPSCABLE usb UPSTYPE usb DEVICE UPSNAME RTIUPS LOCKFILE /var/lock SCRIPTDIR /etc/apcupsd PWRFAILDIR /etc/apcupsd NOLOGINDIR /etc ONBATTERYDELAY 20 BATTERYLEVEL 10 MINUTES 10 TIMEOUT 0 ANNOY 300 ANNOYDELAY 60 NOLOGON disable KILLDELAY 0 NETSERVER on NISIP 127.0.0.1 NISPORT 3551 EVENTSFILE /var/log/apcupsd.events EVENTSFILEMAX 10 UPSCLASS standalone UPSMODE disable STATTIME 0 STATFILE /var/log/apcupsd.status LOGSTATS off DATATIME 0' EOF systemctl enable apcupsd systemctl start apcupsd exit 0