Skip to content

Commit

Permalink
Update bash_aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
kx1t authored Oct 18, 2023
1 parent 15eccb1 commit d38d091
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export DOCKER_HOST="unix:///var/run/docker.sock"

function dexec () {
# shortcut for "docker exec it container bash ..."
[[ -n "$1" ]] && { echo "Usage: dexec <containername> [commands]"; return 99; }
[[ -z "$1" ]] && { echo "Usage: dexec <containername> [commands]"; return 99; } || true
docker ps | grep "Up" >/dev/null 2>&1 || { echo "No containers are running."; return 1; }
docker exec -it $1 bash ${@:2}
}

function dhealth () {
# shows the HealthCheck status for a container
[[ -n "$1" ]] && { echo "Usage: dhealth <container_name>"; return 99; }
[[ -z "$1" ]] && { echo "Usage: dhealth <container_name>"; return 99; } || true
docker ps | grep "Up" >/dev/null 2>&1 || { echo "No containers are running."; return 1; }
docker inspect --format "{{json .State.Health }}" $1 | jq '.Log[].Output'
}
Expand Down

0 comments on commit d38d091

Please sign in to comment.