1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Send destination port for v2ray forward to API

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-10-21 14:51:52 +02:00
parent ad5fa74d25
commit 130378cb72

View file

@ -806,7 +806,7 @@ _vps_firewall_redirect_port() {
if [ "$checkfw" = "" ]; then
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","source_dip" : "'$src_dip'","source_ip" : "'$src_ip'","proto" : "'$protoi'","fwtype" : "ACCEPT","ipproto" : "'$family'"}'
_set_json "shorewallopen" "$settings"
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","destip" : "'$dest_ip'","proto" : "'$protoi'"}'
settings='{"name" : "router '$src_dport'","port" : "'$src_dport'","destip" : "'$dest_ip'","destport" : "'$dest_port'","proto" : "'$protoi'"}'
_set_json "v2rayredirect" "$settings"
fi
if [ "$family" = "ipv4" ]; then
@ -998,6 +998,25 @@ _set_config_from_vps() {
set openmptcprouter.settings.proxy=${current_proxy}
commit openmptcprouter
EOF
if [ "$current_proxy" = "shadowsocks" ]; then
uci -q batch <<-EOF >/dev/null
set shadowsocks-libev.sss0.disabled=0
commit shadowsocks-libev
set v2ray.main.enabled=0
commit shadowsocks-libev
set openmptcprouter.settings.shadowsocks_disable=0
commit openmptcprouter
EOF
elif [ "$current_proxy" = "v2ray" ]; then
uci -q batch <<-EOF >/dev/null
set shadowsocks-libev.sss0.disabled=1
commit shadowsocks-libev
set v2ray.main.enabled=1
commit shadowsocks-libev
set openmptcprouter.settings.shadowsocks_disable=1
commit openmptcprouter
EOF
fi
fi
fi