#!/bin/bash
#source dns.config
1. Get current IP
IP=$(curl -s http://whatismyip.akamai.com/)
echo "$IP"
2. Create/update DNS record
curl -X POST "https://api.vercel.com/v2/domains/$DOMAIN_NAME/records"
-H "Authorization: Bearer drodDKoFAws0d2KnvQ9uL76tA"
-H "Content-Type: application/json"
-d '{
"name": "'v6.fewdrive.eu.org'",
"type": "A",
"value": "'$IP'",
"ttl": 60
}'
echo "Done!"
then
root@OpenWrt:# sh /root/ddns.sh
117.136.38.162
{"error":{"message":"Unsupported Media Type"}}curl: (3) URL rejected: Error
/root/ddns.sh: line 8: -H: not found
/root/ddns.sh: line 9: -H: not found
/root/ddns.sh: line 10: -d: not found
Done!
root@OpenWrt:#
#!/bin/bash
#source dns.config
1. Get current IP
IP=$(curl -s http://whatismyip.akamai.com/)
echo "$IP"
2. Create/update DNS record
curl -X POST "https://api.vercel.com/v2/domains/$DOMAIN_NAME/records"
-H "Authorization: Bearer drodDKoFAws0d2KnvQ9uL76tA"
-H "Content-Type: application/json"
-d '{
"name": "'v6.fewdrive.eu.org'",
"type": "A",
"value": "'$IP'",
"ttl": 60
}'
echo "Done!"
then
root@OpenWrt:
# sh /root/ddns.sh#117.136.38.162
{"error":{"message":"Unsupported Media Type"}}curl: (3) URL rejected: Error
/root/ddns.sh: line 8: -H: not found
/root/ddns.sh: line 9: -H: not found
/root/ddns.sh: line 10: -d: not found
Done!
root@OpenWrt: