changeme.j2 424 B

12345678910111213141516171819
  1. #!/bin/sh
  2. # {{ ansible_managed }}
  3. #
  4. # This shell script if placed in /etc/apcupsd
  5. # will be called by /etc/apcupsd/apccontrol when apcupsd
  6. # detects that the battery should be replaced.
  7. # We send an ntfy message to notify
  8. #
  9. message=$(/sbin/apcaccess status)
  10. curl \
  11. -H "Title: UPS battery needs changing NOW." \
  12. -H "Priority: urgent" \
  13. -H "Tags: warning" \
  14. -d "$message" \
  15. {{ ntfy_url }}/{{ ntfy_topic }}
  16. exit 0