ocserv: avoid setting up the firewall from ocserv.init
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
parent
9a461f16e7
commit
085e028855
1 changed files with 0 additions and 26 deletions
|
@ -4,30 +4,6 @@ SERVICE_USE_PID=1
|
||||||
|
|
||||||
START=50
|
START=50
|
||||||
|
|
||||||
setup_firewall() {
|
|
||||||
local port fw
|
|
||||||
config_get port $1 port
|
|
||||||
test -z "$port" && return
|
|
||||||
|
|
||||||
config_get fwport $1 fwport
|
|
||||||
test "$fwport" = "$port" && return
|
|
||||||
|
|
||||||
logger -t ocserv "opening port $port..."
|
|
||||||
#can we remove the old rule?
|
|
||||||
uci add firewall rule
|
|
||||||
uci set firewall.@rule[-1].src=wan
|
|
||||||
uci set firewall.@rule[-1].name="ocserv-ext-port"
|
|
||||||
uci set firewall.@rule[-1].target=ACCEPT
|
|
||||||
uci set firewall.@rule[-1].proto=tcpudp
|
|
||||||
uci set firewall.@rule[-1].dest_port=$port
|
|
||||||
uci commit firewall
|
|
||||||
|
|
||||||
uci set ocserv.config.fwport="$port"
|
|
||||||
uci commit ocserv
|
|
||||||
|
|
||||||
/etc/init.d/firewall restart
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_config() {
|
setup_config() {
|
||||||
config_get port $1 port "4443"
|
config_get port $1 port "4443"
|
||||||
config_get max_clients $1 max_clients "8"
|
config_get max_clients $1 max_clients "8"
|
||||||
|
@ -170,8 +146,6 @@ start() {
|
||||||
chmod 600 /var/etc/ocpasswd
|
chmod 600 /var/etc/ocpasswd
|
||||||
config_foreach setup_users ocservusers
|
config_foreach setup_users ocservusers
|
||||||
|
|
||||||
setup_firewall config
|
|
||||||
|
|
||||||
service_start /usr/sbin/ocserv -c /var/etc/ocserv.conf
|
service_start /usr/sbin/ocserv -c /var/etc/ocserv.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue