Browse Source

ocserv: added default_domain config option

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lilik-openwrt-22.03
Nikos Mavrogiannopoulos 10 years ago
parent
commit
b87de0a4fa
3 changed files with 10 additions and 4 deletions
  1. +1
    -0
      net/ocserv/README
  2. +1
    -1
      net/ocserv/files/ocserv.conf.template
  3. +8
    -3
      net/ocserv/files/ocserv.init

+ 1
- 0
net/ocserv/README View File

@ -14,6 +14,7 @@ config ocserv 'config'
option ipaddr '10.100.3.0'
option auth 'plain'
option zone 'lan'
option default_domain 'lan'
option enable '1'
config dns


+ 1
- 1
net/ocserv/files/ocserv.conf.template View File

@ -217,7 +217,7 @@ device = vpns
predictable-ips = |PREDICTABLE_IPS|
# The default domain to be advertised
#default-domain = example.com
|ENABLE_DEFAULT_DOMAIN|default-domain = |DEFAULT_DOMAIN|
# The pool of addresses that leases will be given from.
ipv4-network = |IPV4ADDR|


+ 8
- 3
net/ocserv/files/ocserv.init View File

@ -16,13 +16,16 @@ setup_config() {
config_get ipaddr $1 ipaddr "192.168.100.0"
config_get netmask $1 netmask "255.255.255.0"
config_get ip6addr $1 ip6addr ""
config_get default_domain $1 default_domain ""
enable_default_domain="#"
enable_udp="#"
test $predictable_ips = "0" && predictable_ips="false"
test $predictable_ips = "1" && predictable_ips="true"
test $cisco_compat = "0" && cisco_compat="false"
test $cisco_compat = "1" && cisco_compat="true"
test $udp = "0" && udp="#"
test $udp = "1" && udp=""
test $udp = "1" && enable_udp=""
test -z $default_domain && enable_default_domain=""
test -z $ip6addr && enable_ipv6="#"
ipv6_addr=`echo $ip6addr|cut -d '/' -f 1`
@ -42,8 +45,10 @@ setup_config() {
-e "s#|AUTH|#$auth$authsuffix#g" \
-e "s#|DYNDNS|#$dyndns#g" \
-e "s/|PREDICTABLE_IPS|/$predictable_ips/g" \
-e "s/|DEFAULT_DOMAIN|/$default_domain/g" \
-e "s/|ENABLE_DEFAULT_DOMAIN|/$enable_default_domain/g" \
-e "s/|CISCO_COMPAT|/$cisco_compat/g" \
-e "s/|UDP|/$udp/g" \
-e "s/|UDP|/$enable_udp/g" \
-e "s/|IPV4ADDR|/$ipaddr/g" \
-e "s/|NETMASK|/$netmask/g" \
-e "s/|IPV6ADDR|/$ipv6_addr/g" \


Loading…
Cancel
Save