Added validate process for getting IP address of application

This commit is contained in:
2022-11-24 12:56:26 +00:00
parent 5e38eab065
commit 52a5dd2502

View File

@@ -70,6 +70,15 @@ if [ ! -z "$SOURCE" ]; then
for i in $(echo $SOURCE) ; do
name_resolver $i;
debug "source ip is $APP_IP";
if [[ -z "$APP_IP" ]]; then
debug "No any IP address found for SOURCE: $SOURCE, try again to resolv";
name_resolver $i;
debug "source ip is $APP_IP";
if [[ -z "$APP_IP" ]]; then
debug "No any IP address found for SOURCE: $SOURCE, giving up";
fi
fi
SOURCE_IP=$APP_IP;
done
@@ -80,6 +89,15 @@ for i in $(echo $TARGET) ; do
name_resolver $i;
debug "target ip is $APP_IP";
if [[ -z "$APP_IP" ]]; then
debug "No any IP address found for TARGET: $TARGET, try again to resolv";
name_resolver $i;
debug "Target ip is $APP_IP";
if [[ -z "$APP_IP" ]]; then
debug "No any IP address found for TARGET: $TARGET, giving up";
fi
fi
for IP in $(echo $APP_IP); do
IDX=$(expr 1 + $IDX)
eval TARGET_IP_$IDX=$IP;