diff --git a/load.sh b/load.sh index 4e7b2bf..5cd61fd 100755 --- a/load.sh +++ b/load.sh @@ -330,7 +330,7 @@ load_xray_inbounds [ ! -s "$CONFIG_DIR/dns.json" ] && load_xray_dns cp $CONFIG_DIR/*.json $XRAY_DIR/config/ -tar -C $XRAY_DIR -xf $XRAY_DIR/asset.tar.gz +tar -C $XRAY_DIR -xf $XRAY_DIR/asset.tar.gz && rm -f $XRAY_DIR/asset.tar.gz [ ! -s "$ASSET_DIR/geoip.dat" ] && cp $XRAY_DIR/asset/geoip.dat $ASSET_DIR/ [ ! -s "$ASSET_DIR/geosite.dat" ] && cp $XRAY_DIR/asset/geosite.dat $ASSET_DIR/ [ ! -s "$ASSET_DIR/update.sh" ] && load_update_script diff --git a/tproxy.sh b/tproxy.sh index 8333a7e..3f7df6b 100755 --- a/tproxy.sh +++ b/tproxy.sh @@ -18,15 +18,16 @@ ipv4_tproxy() { # IPv4 tproxy settings ip -4 route add local 0.0.0.0/0 dev lo table 100 iptables -t mangle -N XRAY + echo "[TProxy] IPv4 bypass" for cidr in $(ip -4 addr | grep -w "inet" | awk '{print $2}') # bypass local ipv4 range do - echo "[TProxy] IPv4 bypass $cidr" + echo "[TProxy] $cidr" eval "iptables -t mangle -A XRAY -d $cidr -j RETURN" done while read -r cidr # bypass custom ipv4 range do - echo "[TProxy] IPv4 bypass $cidr" + echo "[TProxy] $cidr" eval "iptables -t mangle -A XRAY -d $cidr -j RETURN" done < /etc/xray/expose/network/bypass/ipv4 @@ -40,15 +41,16 @@ ipv6_tproxy() { # IPv6 tproxy settings ip -6 route add local ::/0 dev lo table 106 ip6tables -t mangle -N XRAY6 + echo "[TProxy] IPv6 bypass" for cidr in $(ip -6 addr | grep -w "inet6" | awk '{print $2}') # bypass local ipv6 range do - echo "[TProxy] IPv6 bypass $cidr" + echo "[TProxy] $cidr" eval "ip6tables -t mangle -A XRAY6 -d $cidr -j RETURN" done while read -r cidr # bypass custom ipv6 range do - echo "[TProxy] IPv6 bypass $cidr" + echo "[TProxy] $cidr" eval "ip6tables -t mangle -A XRAY6 -d $cidr -j RETURN" done < /etc/xray/expose/network/bypass/ipv6 @@ -71,4 +73,4 @@ custom_script="/etc/xray/expose/custom.sh" [ -f "$custom_script" ] && sh $custom_script echo "[TProxy] Start xray service." -xray -confdir /etc/xray/config/ +xray -confdir /etc/xray/config