#!/bin/sh # {{ ansible_managed }} # # This shell script if placed in /etc/apcupsd # will be called by /etc/apcupsd/apccontrol when the # UPS goes back on to the mains after a power failure. # We send an ntfy message to notify # message=$(/sbin/apcaccess status) curl \ -H "Title: [$(hostname)] - UPS Power has been restored" \ -H "Priority: default" \ -H "Tags: +1" \ -d "$message" \ {{ ntfy_url }}/{{ ntfy_topic }} exit 0