18 lines
376 B
Bash
Executable File
18 lines
376 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
msg="$1"
|
|
|
|
# Apprise CLI
|
|
if command -v apprise >/dev/null 2>&1; then
|
|
apprise -b "$msg" >/dev/null 2>&1 || true
|
|
fi
|
|
|
|
# Apprise API
|
|
if [[ -n "${APPRISE_API_URL:-}" ]]; then
|
|
curl -s -X POST \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"body\":\"$msg\"}" \
|
|
"$APPRISE_API_URL/notify" >/dev/null 2>&1 || true
|
|
fi
|