From e7d25d2ce4fd2c1c665eed890030af6a33cd6b14 Mon Sep 17 00:00:00 2001 From: mahdavifar2002 Date: Sat, 16 Dec 2023 23:00:37 +0330 Subject: [PATCH] Simpify the script --- script.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/script.sh b/script.sh index c449d98..2cca764 100644 --- a/script.sh +++ b/script.sh @@ -14,11 +14,6 @@ while [[ $# -gt 0 ]]; do shift # past argument shift # past value ;; - -f|--family) - FAMILY="$2" - shift # past argument - shift # past value - ;; -a|--alireza) ALIREZA="$2" shift # past argument @@ -94,23 +89,12 @@ if [ "$IRAN" == "YES" ]; then sudo iptables -t nat -A PREROUTING -p tcp --dport 22 -j ACCEPT # redirect alireza ports -------------------- if [ -v ALIREZA ]; then - sudo iptables -t nat -A PREROUTING -p tcp --dport 12612 -j DNAT --to-destination $ALIREZA sudo iptables -t nat -A PREROUTING -p tcp --dport 8050 -j DNAT --to-destination $ALIREZA:8080 sudo iptables -t nat -A PREROUTING -p tcp -m multiport --dports 1000:6000 -j DNAT --to-destination $ALIREZA fi # redirect proxy ports ---------------------- if [ -v PROXY ]; then - sudo iptables -t nat -A PREROUTING -p tcp -m multiport --dports 80,443 -j DNAT --to-destination $PROXY - sudo iptables -t nat -A PREROUTING -p tcp -m multiport --dports 23 -j DNAT --to-destination $PROXY:22 sudo iptables -t nat -A PREROUTING -p tcp -m multiport --dports 445,777 -j DNAT --to-destination $PROXY:445 - sudo iptables -t nat -A PREROUTING -p tcp --dport 8060 -j DNAT --to-destination $PROXY:8080 - else - sudo iptables -t nat -A PREROUTING -p tcp -m multiport --dports 80,443 -j ACCEPT - fi - # redirect family ports --------------------- - if [ -v FAMILY ]; then - sudo iptables -t nat -A PREROUTING -p tcp --dport 543 -j DNAT --to-destination $FAMILY:443 - sudo iptables -t nat -A PREROUTING -p tcp --dport 8070 -j DNAT --to-destination $FAMILY:8080 fi # redirect other ports ---------------------- sudo iptables -t nat -A PREROUTING -p all -j DNAT --to-destination $SERVER