Skip to content

Commit

Permalink
Add support for custom ntfy servers
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi0n committed Jun 25, 2024
1 parent 9e66047 commit e0f40e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cloudflare-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ sitename="" # Title of site "Example Sit
slackchannel="" # Slack Channel #example
slackuri="" # URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
discorduri="" # URI for Discord WebHook "https://discordapp.com/api/webhooks/xxxxx"
ntfytopic="" # Topic for Ntfy.sh "https://ntfy.sh/xxxxx"
ntfyuri="ntfy.sh" # URI for ntfy server. Default is ntfy.sh
ntfytopic="" # Topic for ntfy.sh "https://ntfy.sh/xxxxx"

###########################################
## Check if we have a public IP
Expand Down Expand Up @@ -130,8 +131,8 @@ case "$update" in
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename Updated" \
-d $record_name"'""s new IP Address is '$ip'" \
ntfy.sh/$ntfytopic
-d $record_name"'s new IP Address is '$ip'" \
$ntfyuri/$ntfytopic
fi
exit 0;;
esac
7 changes: 5 additions & 2 deletions cloudflare-templatev6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ log_header_name="DDNS Updater_v6"
# @slackchannel - Slack Channel #example
# @slackuri - URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
# @discorduri - URI for Discord WebHook "https://discordapp.com/api/webhooks/xxxxx"
# @ntfyuri - URI for ntfy server. Default is ntfy.sh
# @ntfytopic - Topic for Ntfy.sh "https://ntfy.sh/xxxxx"
# -------------------------------------------------- #
sitename=""
slackchannel=""
slackuri=""
discorduri=""
ntfyuri="ntfy.sh"
ntfytopic=""



################################################
## Make sure we have a valid IPv6 connection
################################################
Expand Down Expand Up @@ -171,7 +174,7 @@ case "$update" in
-H "Priority: urgent" \
-H "Tags: warning" \
-d "$record_name: $record_identifier ($ip)." \
ntfy.sh/$ntfytopic
$ntfyuri/$ntfytopic
fi
exit 1
;;
Expand All @@ -194,7 +197,7 @@ case "$update" in
curl \
-H "Title: $sitename Updated" \
-d $record_name"'s new IP Address is $ip" \
ntfy.sh/$ntfytopic
$ntfyuri/$ntfytopic
fi
exit 0
;;
Expand Down

0 comments on commit e0f40e1

Please sign in to comment.