projects
/
gandi_dns_update.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
98ec6ec
)
Remove dbg! macros
author
Greg Burri
<greg.burri@gmail.com>
Tue, 13 Jul 2021 18:27:03 +0000
(20:27 +0200)
committer
Greg Burri
<greg.burri@gmail.com>
Tue, 13 Jul 2021 18:27:03 +0000
(20:27 +0200)
src/main.rs
patch
|
blob
|
history
diff --git
a/src/main.rs
b/src/main.rs
index
33f1981
..
280b718
100644
(file)
--- a/
src/main.rs
+++ b/
src/main.rs
@@
-88,11
+88,9
@@
fn main() -> Result<()> {
fn check_and_update_dns(api_key: &str, fqdn: &str, domains: &Vec<String>, ttl: i32) -> Result<()> {
let real_ip = get_real_ip()?;
fn check_and_update_dns(api_key: &str, fqdn: &str, domains: &Vec<String>, ttl: i32) -> Result<()> {
let real_ip = get_real_ip()?;
- dbg!(&real_ip);
for domain in domains {
let current_ip = get_current_record_ip(api_key, domain, fqdn)?;
for domain in domains {
let current_ip = get_current_record_ip(api_key, domain, fqdn)?;
- dbg!(domain, current_ip);
if real_ip != current_ip {
println!("IP addresses don't match for domain {}: real = {}, dns = {}. Renewing DNS...", domain, real_ip, current_ip);
if real_ip != current_ip {
println!("IP addresses don't match for domain {}: real = {}, dns = {}. Renewing DNS...", domain, real_ip, current_ip);
@@
-177,7
+175,5
@@
fn update_record_ip(api_key: &str, name: &str, fqdn: &str, ip: Ipv4Addr, ttl: i3
let json_value = request_livedns_gandi(api_key, &format!("domains/{}/records/{}/A", fqdn, name), Method::Put(json_body.to_string()))?;
let json_value = request_livedns_gandi(api_key, &format!("domains/{}/records/{}/A", fqdn, name), Method::Put(json_body.to_string()))?;
- dbg!(json_value);
-
Ok(())
}
Ok(())
}