ocserv: enable the X-CSTP-DynDNS header

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
Nikos Mavrogiannopoulos
2014-12-05 20:14:52 +01:00
parent 9ea507c3ab
commit cceb3799e3
3 changed files with 112 additions and 1 deletions
+5
View File
@@ -18,6 +18,11 @@ auth = "|AUTH|"
# A banner to be displayed on clients
banner = "Welcome to OpenWRT"
# When the server has a dynamic DNS address (that may change),
# should set that to true to ask the client to resolve again on
# reconnects.
listen-host-is-dyndns = |DYNDNS|
# Use listen-host to limit to specific IPs or to the IPs of a provided
# hostname.
#listen-host = [IP|HOSTNAME]
+6 -1
View File
@@ -30,12 +30,17 @@ setup_config() {
test $auth = "plain" && authsuffix="\[/var/etc/ocpasswd\]"
dyndns="false"
hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 1`
[ -n "$hostname" ] && dyndns="true"
mkdir -p /var/etc
sed -e "s/|PORT|/$port/g" \
-e "s/|MAX_CLIENTS|/$max_clients/g" \
-e "s/|MAX_SAME|/$max_same/g" \
-e "s/|DPD|/$dpd/g" \
-e "s#|AUTH|#$auth$authsuffix#g" \
-e "s#|DYNDNS|#$dyndns#g" \
-e "s/|PREDICTABLE_IPS|/$predictable_ips/g" \
-e "s/|CISCO_COMPAT|/$cisco_compat/g" \
-e "s/|UDP|/$udp/g" \
@@ -86,7 +91,7 @@ setup_dns() {
start() {
local hostname iface
hostname=`uci get ddns.myddns.domain`
hostname=`uci show ddns|grep domain|head -1|cut -d '=' -f 1`
[ -z "$hostname" ] && hostname=`uci get system.@system[0].hostname`
[ ! -f /etc/ocserv/ca-key.pem ] && [ -x /usr/bin/certtool ] && {