From 774878f6a159a0fb50a8d0b27a95afd1dcd8f297 Mon Sep 17 00:00:00 2001 From: yulewang Date: Sun, 1 Jul 2018 19:23:38 +0800 Subject: [PATCH] Bug fixed --- cf-v4-ddns.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cf-v4-ddns.sh b/cf-v4-ddns.sh index 71326d1..b8b8e27 100644 --- a/cf-v4-ddns.sh +++ b/cf-v4-ddns.sh @@ -101,8 +101,8 @@ ID_FILE=$HOME/.id-cf.txt if [ -f $ID_FILE ] && [ $(wc -l $ID_FILE | cut -d " " -f 1) == 4 ] \ && [ "$(sed -n '3,1p' "$ID_FILE")" == "$CFZONE_NAME" ] \ && [ "$(sed -n '4,1p' "$ID_FILE")" == "$CFRECORD_NAME" ]; then - CFZONE_ID=$(head -1 $ID_FILE) - CFRECORD_ID=$(tail -1 $ID_FILE) + CFZONE_ID=$(sed -n '1,1p' "$ID_FILE") + 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 "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 )