From 5161cfd2138dc9de738499250b6a45912c8e1322 Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Sat, 23 Dec 2023 13:36:50 +0100 Subject: [PATCH] Add check if network does not exist --- utils/podman | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/podman b/utils/podman index 0b7c7b8..4b0cb56 100644 --- a/utils/podman +++ b/utils/podman @@ -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