Check how many APP_IP presents when examine IP addresses

This commit is contained in:
2023-02-13 11:28:59 +00:00
parent 041f9ea00e
commit 05aacbba3c

View File

@@ -114,7 +114,11 @@ name_resolver() {
for D_IP in `echo $UP` ;
do
DNS_IP=$(docker inspect $D_IP -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}');
APP_IP="$APP_IP $DNS_IP";
if [ "$APP_IP" == "" ]; then
APP_IP="$DNS_IP";
else
APP_IP="$APP_IP $DNS_IP";
fi;
echo "APP_IP: "$APP_IP;
done
else