check if networks output is null

This commit is contained in:
abhishek9686 2024-10-07 08:31:55 +04:00
parent ea610281d1
commit f5ff9b903d

View file

@ -743,9 +743,11 @@ test_connection() {
setup_mesh() {
wait_seconds 5
netmakerNet=$(nmctl network list -o json | jq -r '.[] | .netid' | grep -w "netmaker")
inetNet=$(nmctl network list -o json | jq -r '.[] | .netid' | grep -w "internet-access-vpn")
networks=$(nmctl network list -o json)
if [[ ${networks} != "null" ]]; then
netmakerNet=$(nmctl network list -o json | jq -r '.[] | .netid' | grep -w "netmaker")
inetNet=$(nmctl network list -o json | jq -r '.[] | .netid' | grep -w "internet-access-vpn")
fi
# create netmaker network
if [[ ${netmakerNet} = "" ]]; then
echo "Creating netmaker network (100.64.0.0/16)"