mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-20 17:20:12 +01:00
Merge pull request #915 from BastilleBSD/tschettervictor-patch-1
list: Fix listing all in json
This commit is contained in:
@@ -288,7 +288,7 @@ done
|
||||
|
||||
# List json format, otherwise list all jails
|
||||
if [ "${OPT_ALL}" -eq 1 ] && [ "${OPT_JSON}" -eq 1 ]; then
|
||||
list_all | awk 'BEGIN {print "["} NR > 1 {print " {\"JID\": \"" $1 "\", \"State\": \"" $2 "\", \"IP_Address\": \"" $3 "\", \"Hostname\": \"" $5 "\", \"Release\": \"" $6 "\", \"Path\": \"" $7 "\"},"} END {print "]"}' | sed '$s/,$//'
|
||||
list_all | awk 'BEGIN {print "["} NR > 1 {print " {\"JID\": \"" $1 "\", \"Boot\": \"" $2 "\", \"Prio\": \"" $3 "\", \"State\": \"" $4 "\", \"IP_Address\": \"" $5 "\", \"Published_Ports\": \"" $6 "\", \"Hostname\": \"" $7 "\", \"Release\": \"" $8 "\", \"Path\": \"" $9 "\"},"} END {print "]"}' | sed '$s/,$//'
|
||||
elif [ "${OPT_ALL}" -eq 0 ] && [ "${OPT_JSON}" -eq 1 ]; then
|
||||
/usr/sbin/jls -N --libxo json
|
||||
elif [ "${OPT_ALL}" -eq 1 ] && [ "${OPT_JSON}" -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user