curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Simplify the complicated curl command for updating the ddns record.

From: Hongyi Zhao via curl-users <curl-users_at_cool.haxx.se>
Date: Fri, 29 Jan 2021 15:47:39 +0800

Hi,

Currently, I'm using the following command to update the dyndns A
record on the remote provider's DNS server from my intranet machine:

while :; do
  curl -X POST https://dnsapi.cn/Record.Ddns \
       -d "$(
         curl -s -X POST https://dnsapi.cn/Record.List \
              -d
'login_token=id,tocken&format=json&domain=hyddns.xyz&sub_domain=free'
|
                 jq '

"login_token=209395,153bdabe92e6c4212280b7a764967a72&format=json&domain_id="
+ .domain.id
                    + (.records[] | select(.name == "free") |
"&record_id=" + .id + "&record_line_id=" + .line_id +
"&sub_domain=free" )
                    ' |
                 sed -re 's/^"//;s/"$//'
       )" | jq .
  sleep 30
done

As you can see, it's a rather complicated curl invocation. Any
hints/notes/suggestions for simplify such job with curl?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao_at_gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2021-01-29