Skip to content

Commit 52f048b

Browse files
committed
Fix json formatting issue (masonr#80)
1 parent eac2ab2 commit 52f048b

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

yabs.sh

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# performance via fio. The script is designed to not require any dependencies
1313
# - either compiled or installed - nor admin privileges to run.
1414

15-
YABS_VERSION="v2023-11-24"
15+
YABS_VERSION="v2023-11-30"
1616

1717
echo -e '# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #'
1818
echo -e '# Yet-Another-Bench-Script #'
@@ -273,26 +273,13 @@ function ip_info() {
273273
return
274274
fi
275275

276-
local country=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^country/ {print $2}' | head -1)
277-
country=${country//\"}
278-
279-
local region=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^regionName/ {print $2}')
280-
region=${region//\"}
281-
282-
local region_code=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^region/ {print $2}' | head -1)
283-
region_code=${region_code//\"}
284-
285-
local city=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^city/ {print $2}')
286-
city=${city//\"}
287-
288-
local isp=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^isp/ {print $2}')
289-
isp=${isp//\"}
290-
291-
local org=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^org/ {print $2}')
292-
org=${org//\"}
293-
294-
local as=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^as/ {print $2}')
295-
as=${as//\"}
276+
local country=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^country/ {print $2}' | head -1 | sed 's/^"\(.*\)"$/\1/')
277+
local region=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^regionName/ {print $2}' | sed 's/^"\(.*\)"$/\1/')
278+
local region_code=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^region/ {print $2}' | head -1 | sed 's/^"\(.*\)"$/\1/')
279+
local city=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^city/ {print $2}' | sed 's/^"\(.*\)"$/\1/')
280+
local isp=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^isp/ {print $2}' | sed 's/^"\(.*\)"$/\1/')
281+
local org=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^org/ {print $2}' | sed 's/^"\(.*\)"$/\1/')
282+
local as=$(echo "$response" | sed -e 's/[{}]/''/g' | awk -v RS=',"' -F: '/^as/ {print $2}' | sed 's/^"\(.*\)"$/\1/')
296283

297284
echo
298285
echo "$net_type Network Information:"

0 commit comments

Comments
 (0)