pull/90/merge
Avi0n 2 weeks 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 slackchannel="" # Slack Channel #example
slackuri="" # URI for Slack WebHook "https://hooks.slack.com/services/xxxxx" slackuri="" # URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
discorduri="" # URI for Discord WebHook "https://discordapp.com/api/webhooks/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')." "content" : "'"$sitename"' DDNS Update Failed: '$record_name': '$record_identifier' ('$CURRENT_IP')."
}' $discorduri }' $discorduri
fi 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;; exit 1;;
*) *)
logger "DDNS Updater: $CURRENT_IP $record_name DDNS updated." 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'" "content" : "'"$sitename"' Updated: '$record_name''"'"'s'""' new IP Address is '$CURRENT_IP'"
}' $discorduri }' $discorduri
fi fi
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename Updated" \
-d $record_name"'s new IP Address is '$ip'" \
$ntfyuri/$ntfytopic
fi
exit 0;; exit 0;;
esac esac

@ -39,11 +39,15 @@ log_header_name="DDNS Updater_v6"
# @slackchannel - Slack Channel #example # @slackchannel - Slack Channel #example
# @slackuri - URI for Slack WebHook "https://hooks.slack.com/services/xxxxx" # @slackuri - URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
# @discorduri - URI for Discord WebHook "https://discordapp.com/api/webhooks/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="" sitename=""
slackchannel="" slackchannel=""
slackuri="" slackuri=""
discorduri="" discorduri=""
ntfyuri="ntfy.sh"
ntfytopic=""
@ -164,6 +168,14 @@ case "$update" in
\"content\": \"$sitename DDNS Update Failed: $record_name: $record_identifier ($ip).\" \"content\": \"$sitename DDNS Update Failed: $record_name: $record_identifier ($ip).\"
}" $discorduri }" $discorduri
fi 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 exit 1
;; ;;
*) *)
@ -181,6 +193,12 @@ case "$update" in
\"content\": \"$sitename Updated: $record_name's new IPv6 Address is $ip\" \"content\": \"$sitename Updated: $record_name's new IPv6 Address is $ip\"
}" $discorduri }" $discorduri
fi fi
if [[ $ntfytopic != "" ]]; then
curl \
-H "Title: $sitename Updated" \
-d $record_name"'s new IP Address is $ip" \
$ntfyuri/$ntfytopic
fi
exit 0 exit 0
;; ;;
esac esac

Loading…
Cancel
Save