Added validate process for getting IP address of application

This commit is contained in:
2022-11-24 12:51:45 +00:00
parent 054a918370
commit e942411335
2 changed files with 22 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
FROM base-firewall-1.8.8
FROM base-firewall-1.8.7
MAINTAINER gyurix
COPY firewall /firewall
CMD firewall/iptables-wrapper-installer.sh && /firewall/firewall-add

View File

@@ -88,6 +88,16 @@ if [[ -z "$SOURCE_IP" ]]; then
if [[ "$i" != *"."* ]]; then
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
for IP in $(echo $APP_IP); do
IDX=$(expr 1 + $IDX)
eval SOURCE_IP_$IDX=$IP;
@@ -125,6 +135,17 @@ if [[ -z "$TARGET_IP" ]]; then
if [[ "$i" != *"."* ]]; then
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 "source 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;