diff --git a/cloudflare-template.sh b/cloudflare-template.sh old mode 100644 new mode 100755 index 32cbaa8..6cc0f0f --- a/cloudflare-template.sh +++ b/cloudflare-template.sh @@ -12,7 +12,7 @@ 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" - +msteams_webhook_uri="" # URI for Microsoft Teams WebHook "https://outlook.office.com/webhook/xxxxx" ########################################### ## Check if we have a public IP @@ -119,5 +119,11 @@ case "$update" in "content" : "'"$sitename"' Updated: '$record_name''"'"'s'""' new IP Address is '$ip'" }' $discorduri fi + if [[ $msteams_webhook_uri != "" ]]; then + curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST \ + --data-raw '{ + "text" : "'"$sitename"' Updated: '$record_name''"'"'s'""' new IP Address is '$ip'" + }' $msteams_webhook_uri + fi exit 0;; esac diff --git a/cloudflare-templatev6.sh b/cloudflare-templatev6.sh index f393031..3d6d8a0 100644 --- a/cloudflare-templatev6.sh +++ b/cloudflare-templatev6.sh @@ -39,11 +39,13 @@ 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" +# @msteams_webhook_uri - URI for Microsoft Teams WebHook "https://outlook.office.com/webhook/xxxxx" # -------------------------------------------------- # sitename="" slackchannel="" slackuri="" discorduri="" +msteams_webhook_uri="" @@ -181,6 +183,12 @@ case "$update" in \"content\": \"$sitename Updated: $record_name's new IPv6 Address is $ip\" }" $discorduri fi + if [[ $msteams_webhook_uri != "" ]]; then + curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST \ + --data-raw "{ + \"text\": \"$sitename Updated: $record_name's new IPv6 Address is $ip\" + }" $msteams_webhook_uri + fi exit 0 ;; esac