From f553eb97670c0fcc4301470379da2e88e4d4f440 Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Sat, 23 Dec 2023 13:52:01 +0100 Subject: [PATCH] First steps to inspect --- poddoc | 4 ++-- utils/podman | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/poddoc b/poddoc index 07fe294..aa43674 100755 --- a/poddoc +++ b/poddoc @@ -41,8 +41,8 @@ the terms of the ${LICENSE}" # SCRIPT START ## -OPT_SHORT="hVvnp:s:x:" -OPT_LONG="help,version,verbose,dryrun,noconfirm,pull:,start:,stop:" +OPT_SHORT="hVvnp:s:x:i:" +OPT_LONG="help,version,verbose,dryrun,noconfirm,pull:,start:,stop:,inspect:" TEMP=$(getopt -o ${OPT_SHORT} --long ${OPT_LONG} -n $(basename ${0}) -- "$@") if [ "$?" != 0 ]; then diff --git a/utils/podman b/utils/podman index 7a5c3e5..d0431e6 100644 --- a/utils/podman +++ b/utils/podman @@ -23,6 +23,11 @@ function inspectpod() { log e "Podman-directory of ${1} does not exist!" exit 1 fi + + echo -ne "Container-Name: $(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} container.name) +Network: $(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} network.name) +Status:$([[ -n $(podman container ls | grep $(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} container.name)) ]] && ${GREEN} Running ${RESET} || ${RED} Stopped ${RESET}) +Uptime: ${GREEN}$(podman container ls | grep ${1} | awk '{$1=$1};1' | cut -d' ' -f 7-8)${RESET}" } ## @@ -53,6 +58,10 @@ function startpod() { podman-compose up -d } +## +# description: stops and deletes the specified podman container +# usage: stoppod +## function stoppod() { if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then log e "Podman-directory of ${1} does not exist!"