diff --git a/docker-ingress-routing-daemon b/docker-ingress-routing-daemon index aea9d96..29013cd 100755 --- a/docker-ingress-routing-daemon +++ b/docker-ingress-routing-daemon @@ -1,8 +1,8 @@ #!/bin/bash -VERSION=3.1.0 +VERSION=3.2.0 -# Ingress Routing Daemon v3.1.0 +# Ingress Routing Daemon v3.2.0 # Copyright © 2020-2021 Struan Bartlett # ---------------------------------------------------------------------- # Permission is hereby granted, free of charge, to any person @@ -44,9 +44,9 @@ quit() { detect_ingress() { read INGRESS_SUBNET INGRESS_DEFAULT_GATEWAY \ - < <(docker inspect ingress --format '{{(index .IPAM.Config 0).Subnet}} {{index (split (index .Containers "ingress-sbox").IPv4Address "/") 0}}') - - [ -n"$INGRESS_SUBNET" ] && [ -n"$INGRESS_DEFAULT_GATEWAY" ] && return 0 + < <(docker inspect ingress --format '{{(index .IPAM.Config 0).Subnet}} {{index (split (index .Containers "ingress-sbox").IPv4Address "/") 0}}' 2>/dev/null) + + [ -n "$INGRESS_SUBNET" ] && [ -n "$INGRESS_DEFAULT_GATEWAY" ] && nsenter --net=/var/run/docker/netns/ingress_sbox iptables -L >/dev/null && return 0 return 1 }