AppleBag
Regular Contributor
Hi
I copied/pasted verbatim, the CF example script (here) to update my "A" record.
Edited the respective areas, placed it in my jffs/scripts folder and set it's permissions executable. Now in the logs it says it's failing:
--
Apr 6 20:39:57 start_ddns: update CUSTOM , wan_unit 0
Apr 6 20:39:57 custom_script: Running /jffs/scripts/ddns-start (args: 12.12.12.12)
Apr 6 20:39:59 ddns: Custom ddns update failed
--
I'm not super-schooled in either bash scripting or linux, but I grabbed a copy of Cygwin and tried to run the script locally, and it also shows it's failing. Here is how my actual script looks (the keys.ids, email & domain have been randomly changed to 'anon' them, but my actual script has the real ones there.)
--
#!/bin/sh
EMAIL="mycfemail@gmail.com"
ZONEID="3d232432434343243e0f3c16d0e536ac"
RECORDID="12123432428780"
RECORDNAME="my.domain.org"
API="d5188c2132323132112324e1c811108a000f"
IP=${1}
curl -fs -o /dev/null -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$RECORDID" \
-H "X-Auth-Email: $EMAIL" \
-H "X-Auth-Key: $API" \
-H "Content-Type: application/json" \
--data "{\"type\":\"A\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":120,\"proxied\":false}"
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
--
Any idea what's wrong?
TIA
I copied/pasted verbatim, the CF example script (here) to update my "A" record.
Edited the respective areas, placed it in my jffs/scripts folder and set it's permissions executable. Now in the logs it says it's failing:
--
Apr 6 20:39:57 start_ddns: update CUSTOM , wan_unit 0
Apr 6 20:39:57 custom_script: Running /jffs/scripts/ddns-start (args: 12.12.12.12)
Apr 6 20:39:59 ddns: Custom ddns update failed
--
I'm not super-schooled in either bash scripting or linux, but I grabbed a copy of Cygwin and tried to run the script locally, and it also shows it's failing. Here is how my actual script looks (the keys.ids, email & domain have been randomly changed to 'anon' them, but my actual script has the real ones there.)
--
#!/bin/sh
EMAIL="mycfemail@gmail.com"
ZONEID="3d232432434343243e0f3c16d0e536ac"
RECORDID="12123432428780"
RECORDNAME="my.domain.org"
API="d5188c2132323132112324e1c811108a000f"
IP=${1}
curl -fs -o /dev/null -X PUT "https://api.cloudflare.com/client/v4/zones/$ZONEID/dns_records/$RECORDID" \
-H "X-Auth-Email: $EMAIL" \
-H "X-Auth-Key: $API" \
-H "Content-Type: application/json" \
--data "{\"type\":\"A\",\"name\":\"$RECORDNAME\",\"content\":\"$IP\",\"ttl\":120,\"proxied\":false}"
if [ $? -eq 0 ]; then
/sbin/ddns_custom_updated 1
else
/sbin/ddns_custom_updated 0
fi
--
Any idea what's wrong?
TIA