added non-docker case to script

nvim
kdeppe 2 years ago
parent 2cdffc3f57
commit 1840aea989

@ -1,8 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Outputs information about the current docker status # Outputs information about the current docker status
DOCKER_STATUS=$(docker info) EXISTS=$(which docker)
CONTAINERS=$(echo "$DOCKER_STATUS" | awk '/Containers/ {print $2}') if [[ -z $EXISTS ]] ; then
RUNNING=$(echo "$DOCKER_STATUS" | awk '/Running/ {print $2}') echo ""
STOPPED=$(echo "$DOCKER_STATUS" | awk '/Stopped/ {print $2}') else
IMAGES=$(echo "$DOCKER_STATUS" | awk '/Images/ {print $2}') DOCKER_STATUS=$(docker info)
echo -e "\ue7b0 $RUNNING \ufb99 $STOPPED \uf1c5 $IMAGES" CONTAINERS=$(echo "$DOCKER_STATUS" | awk '/Containers/ {print $2}')
RUNNING=$(echo "$DOCKER_STATUS" | awk '/Running/ {print $2}')
STOPPED=$(echo "$DOCKER_STATUS" | awk '/Stopped/ {print $2}')
IMAGES=$(echo "$DOCKER_STATUS" | awk '/Images/ {print $2}')
echo -e "\ue7b0 $RUNNING \ufb99 $STOPPED \uf1c5 $IMAGES"
fi

Loading…
Cancel
Save