diff --git a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js index b30d57c76..55331576e 100644 --- a/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js +++ b/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js @@ -281,8 +281,8 @@ return view.extend({ fwtool.addLimitOption(s); fwtool.addLimitBurstOption(s); - o = s.taboption('advanced', form.Flag, 'v2ray', _('Use V2Ray'), - _('Forward a port (not a range) from server using V2Ray proxy (if enabled) instead of VPN')); + o = s.taboption('advanced', form.Flag, 'v2ray', _('Use V2Ray/XRay'), + _('Forward a port (not a range) from server using V2Ray/XRay proxy (if enabled) instead of VPN')); o.modalonly = true; o.editable = true; o.depends({ src: 'vpn', '!contains': true }); diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index e4c98e048..b32bfe3a7 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -1070,8 +1070,8 @@ _vps_firewall_redirect_port() { #return fi xray="$v2ray" - [ "$(uci -q get v2ray.main.enabled)" = "0" ] && [ "$(uci -q get openmptcprouter.omr.v2ray)" != "down" ] && v2ray="0" - [ "$(uci -q get xray.main.enabled)" = "0" ] && [ "$(uci -q get openmptcprouter.omr.xray)" != "down" ] && xray="0" + ([ "$(uci -q get v2ray.main.enabled)" = "0" ] || [ "$(uci -q get openmptcprouter.omr.v2ray)" = "down" ]) && v2ray="0" + ([ "$(uci -q get xray.main.enabled)" = "0" ] || [ "$(uci -q get openmptcprouter.omr.xray)" = "down" ]) && xray="0" [ "$proto" = "all" ] && proto="tcp udp" [ "$proto" = "" ] && proto="tcp udp" [ "$src" = "vpn" ] && [ -n "$proto" ] && [ -n "$src_dport" ] && [ "$enabled" != "0" ] && [ "$name" != "Allow-DHCP-Request-VPN" ] && { @@ -1221,7 +1221,7 @@ _vps_firewall_redirect_port() { 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}$") + [ "$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}$") @@ -2269,7 +2269,7 @@ _config_service() { [ -n "$(uci -q get openvpn.omr)" ] && [ -z "$(_set_openvpn_vps)" ] && error=1 [ -n "$(uci -q get mlvpn.general)" ] && [ -z "$(_set_mlvpn_vps)" ] && error=1 _set_vps_firewall - [ -n "$(uci -q get wireguard)" ] && [ -z "$(_set_wireguard_vps)" ] && error=1 + [ -n "$(uci -q show network | grep wireguard)" ] && [ -z "$(_set_wireguard_vps)" ] && error=1 fi _backup_list redirect_port="0"