pull/90/merge
Avi0n 1 week ago committed by GitHub
commit e8e9b7e8fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      cloudflare-template.sh
  2. 18
      cloudflare-templatev6.sh

@ -12,6 +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"
ntfyuri="ntfy.sh" # URI for ntfy server. Default is ntfy.sh
ntfytopic="" # Topic for ntfy.sh "https://ntfy.sh/xxxxx"
###########################################
@ -112,6 +114,14 @@ case "$update" in
"content" : "'"$sitename"' DDNS Update Failed: '$record_name': '$record_identifier' ('$CURRENT_IP')."
}' $discorduri
fi
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename DDNS Update Failed" \
-H "Priority: urgent" \
-H "Tags: warning" \
-d "'$record_name': '$record_identifier' ('$ip')." \
$ntfyuri/$ntfytopic
fi
exit 1;;
*)
logger "DDNS Updater: $CURRENT_IP $record_name DDNS updated."
@ -128,5 +138,11 @@ case "$update" in
"content" : "'"$sitename"' Updated: '$record_name''"'"'s'""' new IP Address is '$CURRENT_IP'"
}' $discorduri
fi
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename Updated" \
-d $record_name"'s new IP Address is '$ip'" \
$ntfyuri/$ntfytopic
fi
exit 0;;
esac

@ -39,11 +39,15 @@ 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=""
@ -164,6 +168,14 @@ case "$update" in
\"content\": \"$sitename DDNS Update Failed: $record_name: $record_identifier ($ip).\"
}" $discorduri
fi
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename DDNS Update Failed" \
-H "Priority: urgent" \
-H "Tags: warning" \
-d "$record_name: $record_identifier ($ip)." \
$ntfyuri/$ntfytopic
fi
exit 1
;;
*)
@ -181,6 +193,12 @@ case "$update" in
\"content\": \"$sitename Updated: $record_name's new IPv6 Address is $ip\"
}" $discorduri
fi
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename Updated" \
-d $record_name"'s new IP Address is $ip" \
$ntfyuri/$ntfytopic
fi
exit 0
;;
esac

Loading…
Cancel
Save