mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 18:41:51 +00:00
Fixes on redirection when using XRray or V2Ray
This commit is contained in:
parent
bd629c7b83
commit
da6e20600e
1 changed files with 28 additions and 28 deletions
|
@ -1138,8 +1138,8 @@ _vps_firewall_redirect_port() {
|
|||
checkfw=""
|
||||
if [ "$family" = "ipv4" ]; then
|
||||
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
|
||||
[ "$v2ray" == "1" ] && checkfw=$(echo "$vpsfwlist" | grep "$src_dport # OMR $username open router $src_dport port $protoi --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" == "1" ] && checkfw=$(echo "$vpsfwlist" | grep "$src_dport # OMR $username open router $src_dport port $protoi --- XRay to ${dest_ip}:${dest_port}")
|
||||
[ "$v2ray" = "1" ] && checkfw=$(echo "$vpsfwlist" | grep "$src_dport # OMR $username open router $src_dport port $protoi --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" = "1" ] && checkfw=$(echo "$vpsfwlist" | grep "$src_dport # OMR $username open router $src_dport port $protoi --- XRay to ${dest_ip}:${dest_port}")
|
||||
else
|
||||
comment=""
|
||||
[ -n "$src_dip" ] && {
|
||||
|
@ -1159,58 +1159,58 @@ _vps_firewall_redirect_port() {
|
|||
}
|
||||
}
|
||||
[ -n "$src_ip" ] && comment=" from $src_ip"
|
||||
[ "$v2ray" == "1" ] && checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" == "1" ] && checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}")
|
||||
[ "$v2ray" = "1" ] && checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" = "1" ] && checkfw=$(echo "$vpsfwlist" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}")
|
||||
fi
|
||||
else
|
||||
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
|
||||
[ "$v2ray" == "1" ] && checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" == "1" ] && checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}")
|
||||
[ "$v2ray" = "1" ] && checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" = "1" ] && checkfw=$(echo "$vpsfw6list" | grep "$src_dport # OMR $username open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}")
|
||||
else
|
||||
comment=""
|
||||
[ -n "$src_dip" ] && comment=" to $src_dip"
|
||||
[ -n "$src_ip" ] && comment=" from $src_ip"
|
||||
[ "$v2ray" == "1" ] && checkfw=$(echo "$vpsfw6list" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" == "1" ] && checkfw=$(echo "$vpsfw6list" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}")
|
||||
[ "$v2ray" = "1" ] && checkfw=$(echo "$vpsfw6list" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}")
|
||||
[ "$xray" = "1" ] && checkfw=$(echo "$vpsfw6list" | grep "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}")
|
||||
fi
|
||||
fi
|
||||
if [ "$checkfw" = "" ]; then
|
||||
[ "$v2ray" == "1" ] && settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'${protoi}'","fwtype" : "ACCEPT","ipproto" : "'$family'","comment" : "V2Ray to '${dest_ip}':'${dest_port}'"}'
|
||||
[ "$xray" == "1" ] && settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'${protoi}'","fwtype" : "ACCEPT","ipproto" : "'$family'","comment" : "XRay to '${dest_ip}':'${dest_port}'"}'
|
||||
[ "$v2ray" = "1" ] && settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'${protoi}'","fwtype" : "ACCEPT","ipproto" : "'$family'","comment" : "V2Ray to '${dest_ip}':'${dest_port}'"}'
|
||||
[ "$xray" = "1" ] && settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'${protoi}'","fwtype" : "ACCEPT","ipproto" : "'$family'","comment" : "XRay to '${dest_ip}':'${dest_port}'"}'
|
||||
result=$(_set_json "shorewallopen" "$settings")
|
||||
[ -z "$dest_port" ] && dest_port="$src_dport"
|
||||
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","destip" : "'$dest_ip'","destport" : "'$dest_port'","proto" : "'${protoi}'"}'
|
||||
[ "$v2ray" == "1" ] && result=$(_set_json "v2rayredirect" "$settings")
|
||||
[ "$xray" == "1" ] && result=$(_set_json "xrayredirect" "$settings")
|
||||
[ "$v2ray" = "1" ] && result=$(_set_json "v2rayredirect" "$settings")
|
||||
[ "$xray" = "1" ] && result=$(_set_json "xrayredirect" "$settings")
|
||||
fi
|
||||
if [ "$family" = "ipv4" ]; then
|
||||
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
|
||||
[ "$v2ray" == "1"] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1"] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
else
|
||||
comment=""
|
||||
[ -n "$src_dip" ] && comment=" to $src_dip"
|
||||
[ -n "$src_ip" ] && comment=" from $src_ip"
|
||||
[ "$v2ray" == "1" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfwlist=$(echo "$vpsfwlist" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
fi
|
||||
else
|
||||
if [ "$src_dip" = "" ] && [ "$src_ip" = "" ]; then
|
||||
[ "$v2ray" == "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR $username open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "$src_dport # OMR open router $src_dport port ${protoi} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
else
|
||||
[ -n "$src_dip" ] && comment=" to $src_dip"
|
||||
[ -n "$src_ip" ] && comment=" from $src_ip"
|
||||
[ "$v2ray" == "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" == "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR $username open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
[ "$v2ray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- V2Ray to ${dest_ip}:${dest_port}$")
|
||||
[ "$xray" = "1" ] && [ "$username" = "openmptcprouter" ] && vpsfw6list=$(echo "$vpsfw6list" | grep -v "# OMR open router $src_dport port ${protoi}${comment} --- XRay to ${dest_ip}:${dest_port}$")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue