mirror of
https://git.envs.net/envs/ops.git
synced 2024-06-15 05:16:37 +00:00
small envs_user_updated.sh optimations
This commit is contained in:
parent
8e97f26ad3
commit
d4a11664f8
|
@ -183,15 +183,15 @@ EOM
|
||||||
EOM
|
EOM
|
||||||
else
|
else
|
||||||
# continue user def. array
|
# continue user def. array
|
||||||
if ! [[ "$field_count" -eq '0' ]]; then
|
cat << EOM >> "$TMP_JSON"
|
||||||
cat << EOM >> "$TMP_JSON"
|
|
||||||
"${line_to_set[$field]}",
|
"${line_to_set[$field]}",
|
||||||
EOM
|
EOM
|
||||||
# end of user def. array
|
if [[ "$field_count" -eq '0' ]]; then
|
||||||
else
|
# end of user def. array
|
||||||
|
# remove trailing ',' on last user entry
|
||||||
unset field_in_progress
|
unset field_in_progress
|
||||||
|
sed -i '$ s/,$//' "$TMP_JSON"
|
||||||
cat << EOM >> "$TMP_JSON"
|
cat << EOM >> "$TMP_JSON"
|
||||||
"${line_to_set[$field]}"
|
|
||||||
],
|
],
|
||||||
EOM
|
EOM
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user