Handle status properly if container is not installed

pull/1/head
riley 1 year ago
parent 6f69de39b2
commit 4795f05880

@ -101,7 +101,11 @@ case "${ACTION}" in
"status") "status")
APP_NAME="btcpayserver" APP_NAME="btcpayserver"
CONTAINER_NAMES=$(docker ps -a --filter "name=${APP_NAME}" --format '{{.Names}}') CONTAINER_NAMES=$(docker ps -a --filter "name=${APP_NAME}" --format '{{.Names}}')
docker ps --all -f "name=${CONTAINER_NAMES}" --format '{{.Status}}' if [ -z "$CONTAINER_NAMES" ]; then
echo "${APP_NAME} is not installed."
else
docker ps --all -f "name=${CONTAINER_NAMES}" --format '{{.Status}}'
fi
;; ;;
"port") "port")
APP_NAME="btcpayserver" APP_NAME="btcpayserver"

Loading…
Cancel
Save