12345678910111213141516171819 |
- #!/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: warning" \
- -d "$message" \
- {{ ntfy_url }}/{{ ntfy_topic }}
- exit 0
|