mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-22 15:02:23 +00:00
8 lines
279 B
Bash
8 lines
279 B
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
|