Add check if network does not exist
This commit is contained in:
parent
4c504b03aa
commit
5161cfd213
1 changed files with 3 additions and 1 deletions
|
@ -40,7 +40,9 @@ function startpod() {
|
|||
# check if network is needed
|
||||
if [[ -n $(jq -r .network.name "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/config.json") ]]; then
|
||||
local network="$(jq -r .network.name $(getValueByKey 'PODMAN_DIRECTORY')/${1}/config.json)"
|
||||
podman network create "$network"
|
||||
if [[ -z $(podman network ls | grep "$network") ]]; then
|
||||
podman network create "$network"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n $(podman container ls | grep $(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} container.name)) ]]; then
|
||||
|
|
Loading…
Reference in a new issue