mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 18:22:47 +01:00
Added Comments for future enhancements
This commit is contained in:
@@ -103,9 +103,13 @@ create_expected_container_list() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
populate_container_lists() {
|
populate_container_lists() {
|
||||||
|
# TODO: check exit code directly, not with $?
|
||||||
systemctl is-active --quiet docker
|
systemctl is-active --quiet docker
|
||||||
|
|
||||||
if [[ $? = 0 ]]; then
|
if [[ $? = 0 ]]; then
|
||||||
|
# TODO: why use curl when you can just run docker ps?
|
||||||
|
# TODO: why use an indexed array when bash has associtive arrays?
|
||||||
|
# TODO: why use an array when you can just use a string?
|
||||||
mapfile -t docker_raw_list < <(curl -s --unix-socket /var/run/docker.sock http:/v1.40/containers/json?all=1 \
|
mapfile -t docker_raw_list < <(curl -s --unix-socket /var/run/docker.sock http:/v1.40/containers/json?all=1 \
|
||||||
| jq -c '.[] | { Name: .Names[0], State: .State }' \
|
| jq -c '.[] | { Name: .Names[0], State: .State }' \
|
||||||
| tr -d '/{"}')
|
| tr -d '/{"}')
|
||||||
|
|||||||
Reference in New Issue
Block a user