1 changed files with 9 additions and 3 deletions
@ -1,10 +1,16 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
|
|
||||
if [[ -z $1 || $1 == "-h" || $1 == "--help" ]]; then |
if [[ -z $1 || $1 == "-h" || $1 == "--help" ]]; then |
||||
echo "Usage: $(basename $0) container |
echo "Usage: $(basename $0) container [command] |
||||
|
|
||||
Start a shell on the given container, and connect to it." |
Runs a bash shell on the given container. If second argument is |
||||
|
omitted, an interactive login shell is launched. If second argument |
||||
|
is given, the string is interpreted as a command and executed." |
||||
exit 1 |
exit 1 |
||||
fi |
fi |
||||
|
|
||||
podman exec -it $1 bash |
if [[ -z $2 ]]; then |
||||
|
podman exec -it $1 bash -l |
||||
|
else |
||||
|
podman exec -it $1 bash -c "$2" |
||||
|
fi |
||||
|
Loading…
Reference in new issue