backup: add emoji tag to ntfy message

This commit is contained in:
cy 2024-12-31 12:20:32 -05:00
parent cf3a7df57e
commit 04dcdc2003

View file

@ -110,8 +110,15 @@ in
title="${hostname}: backup completed with exit code: $exitStatus" title="${hostname}: backup completed with exit code: $exitStatus"
msg=$(journalctl -o cat _SYSTEMD_INVOCATION_ID=$invocationId) msg=$(journalctl -o cat _SYSTEMD_INVOCATION_ID=$invocationId)
if [ "$exitStatus" -eq 0 ]; then
tag="v"
else
tag="rotating_light"
fi
${pkgs.curl}/bin/curl -sL -u $(cat ${config.sops.secrets."services/ntfy".path}) \ ${pkgs.curl}/bin/curl -sL -u $(cat ${config.sops.secrets."services/ntfy".path}) \
-H "Title: $title" \ -H "Title: $title" \
-H "Tags: $tag" \
-d "$msg" \ -d "$msg" \
https://ntfy.cything.io/backups > /dev/null https://ntfy.cything.io/backups > /dev/null
''; '';