Revamp.
This commit is contained in:
@@ -2,17 +2,16 @@
|
||||
set -euo pipefail
|
||||
|
||||
msg="$1"
|
||||
APPRISE_API_URL="${APPRISE_API_URL:-}"
|
||||
|
||||
# Apprise CLI
|
||||
# Local Apprise CLI if available
|
||||
if command -v apprise >/dev/null 2>&1; then
|
||||
apprise -b "$msg" >/dev/null 2>&1 || true
|
||||
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" \
|
||||
-F "{\"body\":\"$msg\"}" \
|
||||
-F "tags=all" \
|
||||
"$APPRISE_API_URL" >/dev/null 2>&1 || true
|
||||
if [[ -n "$APPRISE_API_URL" ]]; then
|
||||
curl -fsS -X POST -H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg b "$msg" '{body:$b}')" \
|
||||
"$APPRISE_API_URL/notify" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user