mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-09 02:43:53 +08:00
openvpn: fix uci-defaults script (#5103)
修复防火墙端口号。用户如果设置自定义端口,例如1197,则升级固件时,需要uci查询用户设定的自定义端口号,然后打开防火墙端口。
This commit is contained in:
parent
9c7e1500dc
commit
5cfcdc8c82
@ -1,5 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
openvpn_port="$(uci -q get openvpn.myvpn.port)"
|
||||
[ -z "$openvpn_port" ] && openvpn_port=1194
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete network.vpn0
|
||||
set network.vpn0=interface
|
||||
@ -14,7 +17,7 @@ uci -q batch <<-EOF >/dev/null
|
||||
set firewall.openvpn.target='ACCEPT'
|
||||
set firewall.openvpn.src='wan'
|
||||
set firewall.openvpn.proto='tcp udp'
|
||||
set firewall.openvpn.dest_port='1194'
|
||||
set firewall.openvpn.dest_port="$openvpn_port"
|
||||
|
||||
delete firewall.vpn
|
||||
set firewall.vpn=zone
|
||||
|
Loading…
x
Reference in New Issue
Block a user