Changing execution orders

This commit is contained in:
2022-03-21 10:46:37 +00:00
parent a4fdb05433
commit 6da9d2efd0

View File

@@ -49,15 +49,6 @@ elif [[ "$(echo $TARGET_IP | cut -d . -f4)" == "0" ]] ; then
debug "target ip is $TARGET_IP" debug "target ip is $TARGET_IP"
fi; fi;
##############################
echo 1 > /proc/sys/net/ipv4/ip_forward
##############################
IPTABLES=/sbin/iptables-legacy
###############################
prerouting() { prerouting() {
LINES=$($IPTABLES -L --line-number -n | grep $SOURCE_PORT |grep $TARGET_IP |grep $TARGET_PORT |grep $COMMENT | awk '{print $1}'| tac) LINES=$($IPTABLES -L --line-number -n | grep $SOURCE_PORT |grep $TARGET_IP |grep $TARGET_PORT |grep $COMMENT | awk '{print $1}'| tac)
@@ -130,8 +121,19 @@ if [[ "$ROUTE" == "true" ]] ; then
debug "ip_route: "$IP_ROUTE; debug "ip_route: "$IP_ROUTE;
ip_route; ip_route;
exit;
fi fi
##############################
echo 1 > /proc/sys/net/ipv4/ip_forward
##############################
IPTABLES=/sbin/iptables-legacy
###############################
COUNT_SOURCE_IP=$(set |grep SOURCE_IP |wc -l) COUNT_SOURCE_IP=$(set |grep SOURCE_IP |wc -l)
COUNT_SOURCE_PORT=$(set |grep SOURCE_PORT |wc -l) COUNT_SOURCE_PORT=$(set |grep SOURCE_PORT |wc -l)
COUNT_TARGET_IP=$(set |grep TARGET_IP |wc -l) COUNT_TARGET_IP=$(set |grep TARGET_IP |wc -l)