mirror of
https://github.com/aipeach/cloudflare-api-v4-ddns.git
synced 2025-01-18 22:09:28 +08:00
added head -1 to CFRECORD request, to enable updates to the root domain
This commit is contained in:
parent
8b5fd9ea4b
commit
7fc8d47928
@ -106,7 +106,7 @@ if [ -f $ID_FILE ] && [ $(wc -l $ID_FILE | cut -d " " -f 1) == 4 ] \
|
|||||||
else
|
else
|
||||||
echo "Updating zone_identifier & record_identifier"
|
echo "Updating zone_identifier & record_identifier"
|
||||||
CFZONE_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$CFZONE_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 )
|
CFZONE_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$CFZONE_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 )
|
||||||
CFRECORD_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID/dns_records?name=$CFRECORD_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*')
|
CFRECORD_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID/dns_records?name=$CFRECORD_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 )
|
||||||
echo "$CFZONE_ID" > $ID_FILE
|
echo "$CFZONE_ID" > $ID_FILE
|
||||||
echo "$CFRECORD_ID" >> $ID_FILE
|
echo "$CFRECORD_ID" >> $ID_FILE
|
||||||
echo "$CFZONE_NAME" >> $ID_FILE
|
echo "$CFZONE_NAME" >> $ID_FILE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user