pull/48/merge
Vasyl Gnatiuk 1 month ago committed by GitHub
commit a38c938929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 15
      cloudflare-template.sh

@ -12,7 +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"
telegramtoken="" # Telegram bot API Token
telegramchatid="" # Telegram Chat ID
########################################### ###########################################
## Check if we have a public IP ## Check if we have a public IP
@ -112,6 +113,12 @@ 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 [[ $telegramtoken != "" ]] && [[ $telegramchatid != "" ]]; then
curl -H 'Content-Type: application/json' -X POST \
--data-raw '{
"chat_id": "'$telegramchatid'", "text": "'"$sitename"' DDNS Update Failed: '$record_name': '$record_identifier' ('$ip')."
}' https://api.telegram.org/bot$telegramtoken/sendMessage
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 +135,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 [[ $telegramtoken != "" ]] && [[ $telegramchatid != "" ]]; then
curl -H 'Content-Type: application/json' -X POST \
--data-raw '{
"chat_id": "'$telegramchatid'", "text": "'"$sitename"' Updated: '$record_name''"'"'s'""' new IP Address is '$ip'"
}' https://api.telegram.org/bot$telegramtoken/sendMessage
fi
exit 0;; exit 0;;
esac esac

Loading…
Cancel
Save