Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid requests when having multiple records with the same name #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Update the config parameters inside the update-cloudflare-dns_conf.ps1 by editin
| telegram_chat_id | ChangeMe | Chat ID of the bot |
| telegram_bot_API_Token | ChangeMe | Telegram's Bot API Token |

To find the telegram_chat_id try to use https://t.me/myidbot

### Optional Notification Parameters for Discord

| **Option** | **Example** | **Description** |
Expand Down
3 changes: 2 additions & 1 deletion update-cloudflare-dns.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Write-Output "==> DNS record of $dns_record is: $dns_record_ip. Trying to update
$cloudflare_record_info = @{
Uri = "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records?name=$dns_record"
Headers = @{"Authorization" = "Bearer $cloudflare_zone_api_token"; "Content-Type" = "application/json" }
Body = @{"type" = "A"}
}

$cloudflare_record_info_resposne = Invoke-RestMethod @cloudflare_record_info
Expand Down Expand Up @@ -172,4 +173,4 @@ if ($notify_me_discord -eq "yes") {
Write-Host "==> Request StatusDescription:" $_.Exception.Response.StatusDescription | Tee-Object $File_LOG -Append
}
Exit
}
}