Use more appropriate API to check if the container already exists

https://github.com/debarshiray/toolbox/pull/122
This commit is contained in:
Debarshi Ray 2019-04-17 12:49:46 +02:00
parent 8db3317807
commit c0f476e2f2

View file

@ -691,7 +691,7 @@ create()
echo "$base_toolbox_command: checking if container $toolbox_container already exists" >&3
enter_command=$(create_enter_command "$toolbox_container")
if $prefix_sudo podman inspect --type container $toolbox_container >/dev/null 2>&3; then
if $prefix_sudo podman container exists $toolbox_container >/dev/null 2>&3; then
echo "$base_toolbox_command: container $toolbox_container already exists" >&2
echo "Enter with: $enter_command" >&2
echo "Try '$base_toolbox_command --help' for more information." >&2