summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
Diffstat (limited to 'lib/container/list')
-rwxr-xr-xlib/container/list46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/container/list b/lib/container/list
index a5f1e62..714c803 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -97,27 +97,7 @@ FORMAT="${FORMAT:-full}"
HOST="${HOST:-$(hostname -f)}"
# Run
-case "${FORMAT}" in
- full)
- RED="$(tput setaf 1)$(tput bold)"
- GREEN="$(tput setaf 2)$(tput bold)"
- YELLOW="$(tput setaf 3)$(tput bold)"
- BLUE="$(tput setaf 4)$(tput bold)"
- WHITE="$(tput setaf 7)$(tput bold)"
- NORMAL="$(tput sgr0)"
-
-cat << EOF
-${WHITE} ${NORMAL} Container IPv4 Address(es)
---------------------------------------------------------------------------------
-EOF
-
- ;;
-
- short)
- ;;
-esac
-
-Show ()
+List ()
{
case "${FORMAT}" in
short)
@@ -144,6 +124,26 @@ Show ()
esac
}
+case "${FORMAT}" in
+ full)
+ RED="$(tput setaf 1)$(tput bold)"
+ GREEN="$(tput setaf 2)$(tput bold)"
+ YELLOW="$(tput setaf 3)$(tput bold)"
+ BLUE="$(tput setaf 4)$(tput bold)"
+ WHITE="$(tput setaf 7)$(tput bold)"
+ NORMAL="$(tput sgr0)"
+
+cat << EOF
+${WHITE} ${NORMAL} Container IPv4 Address(es)
+--------------------------------------------------------------------------------
+EOF
+
+ ;;
+
+ short)
+ ;;
+esac
+
CONTAINERS="$(cd "${MACHINES}" 2>/dev/null && find -maxdepth 1 -type d -and -not -name '.container-tools' -and -not -name 'container-tools' -and -not -name 'lost+found' -and -not -name '.snap' -and -not -name '.snapshot' -printf '%P\n' | sort)"
for CONTAINER in ${CONTAINERS}
@@ -197,7 +197,7 @@ do
if echo ${LIST} | grep -qs all
then
- Show
+ List
fi
for ITEM in other started stopped
@@ -206,7 +206,7 @@ do
then
case "${STATE}" in
${ITEM})
- Show
+ List
;;
esac
fi