mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 09:54:06 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#!/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 "$@"
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/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 'Content-Type: application/json' \
|
||||
-d '{"token":"'"${TOKEN}"'","user":"'"${TO_ID}"'","device":"'"${DEVICE}"'","message":"'"${text}"'","title":"'"${TITLE}"'","html":"'"${HTML}"'"}' \
|
||||
--url https://${custom_domain:-api.pushover.net}/1/messages.json
|
||||
}
|
||||
|
||||
|
||||
# All external parameters required
|
||||
ALL_PARAMS="custom_domain text tokens"
|
||||
eval "$(JSON_EXPORT "$1")"; shift
|
||||
# All external tokens required
|
||||
INIT_GLOBAL_VAR TOKEN TO_ID DEVICE TITLE HTML
|
||||
eval "$tokens"
|
||||
start "$@"
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2023-2025 muink https://github.com/muink
|
||||
#
|
||||
# Port update notify script
|
||||
#
|
||||
# depends
|
||||
|
||||
. /usr/lib/natmap/common.sh
|
||||
|
||||
start() {
|
||||
local retry='--connect-timeout 3 --retry 5'
|
||||
|
||||
# 如果 CUESTOM_PROXY 不为空,则添加 -x 参数
|
||||
local proxy_param=${CUESTOM_PROXY:+-x $CUESTOM_PROXY}
|
||||
|
||||
$CURL $retry -L -o /dev/null -X POST $proxy_param \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"chat_id":"'"${CHAT_ID}"'","text":"'"${text}"'","parse_mode":"HTML","disable_notification":"false"}' \
|
||||
--url "https://${custom_domain:-api.telegram.org}/bot${TOKEN}/sendMessage"
|
||||
}
|
||||
|
||||
|
||||
# All external parameters required
|
||||
ALL_PARAMS="custom_domain text tokens"
|
||||
eval "$(JSON_EXPORT "$1")"; shift
|
||||
# All external tokens required
|
||||
INIT_GLOBAL_VAR TOKEN CHAT_ID CUESTOM_PROXY
|
||||
eval "$tokens"
|
||||
start "$@"
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2023 muink https://github.com/muink
|
||||
#
|
||||
# Port update notify script
|
||||
#
|
||||
# depends
|
||||
|
||||
. /usr/lib/natmap/common.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
# http_request <data>
|
||||
http_request() {
|
||||
local data="$1"
|
||||
$CURL $retry -L -o /dev/null -X POST \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "$data" \
|
||||
--url https://${custom_domain:-ntfy.sh}/
|
||||
}
|
||||
|
||||
start() {
|
||||
local retry='--connect-timeout 3 --retry 5'
|
||||
json_init
|
||||
json_add_string topic "${TOPIC}"
|
||||
json_add_string message "${text}"
|
||||
json_add_string title "${TITLE}"
|
||||
|
||||
# Add priority and tag option
|
||||
json_add_int priority "${PRIORITY:-3}"
|
||||
json_add_array tags
|
||||
for _t in ${TAGS//,/ }; do
|
||||
json_add_string "" "$_t"
|
||||
done
|
||||
json_close_array
|
||||
|
||||
[ -n "${WACTION}" ] && {
|
||||
json_add_array actions
|
||||
json_add_object
|
||||
json_add_string action "view"
|
||||
json_add_string label "Open page"
|
||||
json_add_string url "http${HTTPS:+s}://${ip}:${port}"
|
||||
json_add_boolean clear 0
|
||||
json_close_object
|
||||
json_close_array
|
||||
}
|
||||
http_request "$(json_dump)"
|
||||
}
|
||||
|
||||
|
||||
# All external parameters required
|
||||
ALL_PARAMS="custom_domain text tokens"
|
||||
eval "$(JSON_EXPORT "$1")"; shift
|
||||
# All external tokens required
|
||||
INIT_GLOBAL_VAR TOPIC TITLE WACTION HTTPS PRIORITY TAGS
|
||||
eval "$tokens"
|
||||
start "$@"
|
||||
Reference in new issue
Block a user