add(scripts)
This commit is contained in:
1 parent
91fed9c763
commit
245686ec71
2 files changed
+50
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
mkdir -p configs
|
||||
if [ -n "$*" ]; then
|
||||
statusResponse=$(isp-ctl $* status)
|
||||
else
|
||||
statusResponse=$(isp-ctl status)
|
||||
fi
|
||||
|
||||
firstRecordSkip="MODULE"
|
||||
secondRecordSkip="+------------------------+---------------+-------------------------------+"
|
||||
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 $* get $module_name .) >configs/$module_name.json
|
||||
else
|
||||
echo $(isp-ctl get $module_name .) >configs/$module_name.json
|
||||
fi
|
||||
fi
|
||||
break
|
||||
done
|
||||
done
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
mkdir -p schemas
|
||||
if [ -n "$*" ]; then
|
||||
statusResponse=$(isp-ctl $* status)
|
||||
else
|
||||
statusResponse=$(isp-ctl status)
|
||||
fi
|
||||
|
||||
firstRecordSkip="MODULE"
|
||||
secondRecordSkip="+------------------------+---------------+-------------------------------+"
|
||||
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
|
||||
done
|
||||
Reference in new issue
Block a user