mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 09:46:19 +00:00
Check if the container is running, and if not then print a meaningful error message.
This commit is contained in:
parent
58b9040a36
commit
b1b039cdd1
@ -1 +1,7 @@
|
||||
nsenter --target $(docker inspect --format '{{.State.Pid}}' $1) --mount --uts --ipc --net --pid bash
|
||||
#!/bin/bash
|
||||
CONTAINER_PID=$(docker inspect --format '{{if .State.Running}}{{.State.Pid}}{{end}}' $1)
|
||||
if [ -z $CONTAINER_PID ]; then
|
||||
read -p "Application must be running for a terminal to be started."
|
||||
else
|
||||
nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid bash
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user