From 38d0e8bd71b83a954dd372b66ba7f7a1c3ef7c78 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 21 Apr 2021 18:55:23 +0200 Subject: containers: T2216: add op-mode "show container network" command --- src/op_mode/containers_op.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/op_mode') diff --git a/src/op_mode/containers_op.sh b/src/op_mode/containers_op.sh index bdc0ead98..9c410bd7f 100755 --- a/src/op_mode/containers_op.sh +++ b/src/op_mode/containers_op.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Expect 2 args or "show-containers" or "show-images" -if [[ $# -ne 2 ]] && [[ $1 != "--show-containers" ]] && [[ $1 != "--show-images" ]] ; then +if [[ $# -ne 2 ]] && [[ $1 != "--show-containers" ]] && [[ $1 != "--show-images" ]] && [[ $1 != "--show-networks" ]] ; then echo "Image not set or not found" exit 1 fi @@ -29,6 +29,10 @@ show_images() { sudo podman image ls } +# Show networks +show_networks() { + sudo podman network ls +} if [ "$OPTION" = "--pull" ]; then pull_image @@ -45,6 +49,11 @@ if [ "$OPTION" = "--show-containers" ]; then exit 0 fi +if [ "$OPTION" = "--show-networks" ]; then + show_networks + exit 0 +fi + if [ "$OPTION" = "--show-images" ]; then show_images exit 0 -- cgit v1.2.3