#!/bin/sh # {{ ansible_managed }} # # This shell script if placed in /etc/apcupsd # will be called by /etc/apcupsd/apccontrol when apcupsd # detects that the battery should be replaced. # We send an ntfy message to notify # message=$(/sbin/apcaccess status) curl \ -H "Title: UPS battery needs changing NOW." \ -H "Priority: urgent" \ -H "Tags: skull" \ -d "$message" \ {{ ntfy_url }}/{{ ntfy_topic }} exit 0