From 54a0507609a27088e488cb9db67046c22d1b1094 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Thu, 22 Sep 2016 22:18:13 +0800 Subject: [PATCH] Modify jq cmd for parse index.json file. --- lxc-images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc-images.sh b/lxc-images.sh index baf196b..9e230c5 100755 --- a/lxc-images.sh +++ b/lxc-images.sh @@ -22,7 +22,7 @@ wget -c -T5 -O "${TUNASYNC_WORKING_DIR}/meta/1.0/index-user" "${BASE_URL}/meta/1 mkdir -p "${TUNASYNC_WORKING_DIR}/streams/v1" wget -c -T5 -O "${TUNASYNC_WORKING_DIR}/streams/v1/index.json" "${BASE_URL}/streams/v1/index.json" -jq -r '.index.images.path' "${TUNASYNC_WORKING_DIR}/streams/v1/index.json" | while read line; do +jq -r '.index[].path' "${TUNASYNC_WORKING_DIR}/streams/v1/index.json" | while read line; do [ ! -d "${TUNASYNC_WORKING_DIR}/$(dirname $line)" ] && mkdir -p "${TUNASYNC_WORKING_DIR}/$(dirname $line)" wget -c -T5 -O "${TUNASYNC_WORKING_DIR}/${line}" "${BASE_URL}/${line}" done