op-packages/openwrt-natmapt/files/notify/Pushbullet
github-actions[bot] 32600acc60 🌴 Sync 2026-03-05 23:51:42
2026-03-05 23:51:42 +08:00

27 lines
633 B
Bash

#!/bin/sh
# Copyright (C) 2023 muink https://github.com/muink
#
# Port update notify script
#
# depends
. /usr/lib/natmap/common.sh
start() {
local retry='--connect-timeout 3 --retry 5'
$CURL $retry -L -o /dev/null -X POST \
-H "Access-Token: ${TOKEN}" \
-H 'Content-Type: application/json' \
-d '{"type":"note","body":"'"${text}"'","title":"'"${TITLE}"'"}' \
--url "https://${custom_domain:-api.pushbullet.com}/v2/pushes"
}
# All external parameters required
ALL_PARAMS="custom_domain text tokens"
eval "$(JSON_EXPORT "$1")"; shift
# All external tokens required
INIT_GLOBAL_VAR TOKEN TITLE
eval "$tokens"
start "$@"