poddoc/utils/inspect

13 lines
662 B
Bash

#!/usr/bin/env bash
function inspectpod() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Podman-directory of ${1} does not exist!"
exit 1
fi
echo -e "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)) ]] && echo -e ${GREEN}Running${RESET} || echo -e ${RED}Stopped${RESET})
Uptime: ${GREEN}$(podman container ls | grep ${1} | awk '{$1=$1};1' | cut -d' ' -f 7-8)${RESET}"
}