From e1bb3543cfbcb7e476f1f059383d37d2eda86147 Mon Sep 17 00:00:00 2001 From: jouyouyun Date: Tue, 24 Oct 2023 14:04:35 +0800 Subject: [PATCH] Fix abnormal exit in alpine --- cf-v4-ddns.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 cf-v4-ddns.sh diff --git a/cf-v4-ddns.sh b/cf-v4-ddns.sh old mode 100644 new mode 100755 index 20fd4b9..3cc4ffc --- a/cf-v4-ddns.sh +++ b/cf-v4-ddns.sh @@ -110,8 +110,8 @@ if [ -f $ID_FILE ] && [ $(wc -l $ID_FILE | cut -d " " -f 1) == 4 ] \ CFRECORD_ID=$(sed -n '2,1p' "$ID_FILE") else echo "Updating zone_identifier & record_identifier" - CFZONE_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$CFZONE_NAME" -H "Authorization: Bearer $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 "Authorization: Bearer $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 "Authorization: Bearer $CFKEY" -H "Content-Type: application/json" | grep -Eo '"id":"[^"]*'|sed 's/"id":"//' | head -1 ) + CFRECORD_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID/dns_records?name=$CFRECORD_NAME" -H "Authorization: Bearer $CFKEY" -H "Content-Type: application/json" | grep -Eo '"id":"[^"]*'|sed 's/"id":"//' | head -1 ) echo "$CFZONE_ID" > $ID_FILE echo "$CFRECORD_ID" >> $ID_FILE echo "$CFZONE_NAME" >> $ID_FILE