update(script schema response to html)

This commit is contained in:
DeniskaRediska committed 2019-09-06 18:31:00 +03:00
1 parent 245686ec71
commit 6186eb2786
2 files changed
+28 -24

No files matched your search

+17 -14
View File
@@ -6,20 +6,23 @@ else
statusResponse=$(isp-ctl status)
fi
firstRecordSkip="MODULE"
secondRecordSkip="+------------------------+---------------+-------------------------------+"
i=0
IFS=$'\n'
for status in $statusResponse; do
IFS=$' '
read -ra ADDR <<<"$status"
for module_name in "${ADDR[0]}"; do
if [ "$module_name" != "$firstRecordSkip" ] && [ "$module_name" != "$secondRecordSkip" ]; then
if [ -n "$*" ]; then
echo $(isp-ctl $* schema $module_name) >schemas/$module_name.json
else
echo $(isp-ctl schema $module_name) >schemas/$module_name.json
fi
fi
break
done
if [ $i -ne 2 ]; then
i=$(( i + 1 ))
else
IFS=$' '
read -ra ADDR <<<"$status"
for module_name in "${ADDR[0]}"; do
if [ -n "$*" ]; then
echo $(isp-ctl $* schema $module_name -o html) >schemas/$module_name.html
else
echo $(isp-ctl schema $module_name -o html) >schemas/$module_name.html
fi
break
done
fi
done