aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-11-24 23:51:32 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-11-24 23:52:58 +0100
commit1f9b054deb9c7338c26be5bfa47dc9f778872e94 (patch)
tree81324821d1881d29eb5f7b0cdf36bb315d9dde74
parent77309771350a40307d20c473c14536989e472cc5 (diff)
vpnc-script: create dnsmasq entries for connections where default domain is set
Relates to #1975 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r--net/vpnc-scripts/Makefile2
-rwxr-xr-xnet/vpnc-scripts/files/vpnc-script18
2 files changed, 16 insertions, 4 deletions
diff --git a/net/vpnc-scripts/Makefile b/net/vpnc-scripts/Makefile
index 3af3695ae..350afec93 100644
--- a/net/vpnc-scripts/Makefile
+++ b/net/vpnc-scripts/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=vpnc-scripts
PKG_VERSION:=20150116
-PKG_RELEASE:=2
+PKG_RELEASE:=3
include $(INCLUDE_DIR)/package.mk
diff --git a/net/vpnc-scripts/files/vpnc-script b/net/vpnc-scripts/files/vpnc-script
index 48c8ed04b..7660d9c6d 100755
--- a/net/vpnc-scripts/files/vpnc-script
+++ b/net/vpnc-scripts/files/vpnc-script
@@ -81,10 +81,10 @@ do_connect() {
[[ "$addr" != "$mask" ]] && proto_add_ipv6_address "$addr" "$mask"
fi
+ DNSMASQ_FILE="/tmp/dnsmasq.d/openconnect.$TUNDEV"
+ rm -f $DNSMASQ_FILE
if [ -n "$CISCO_SPLIT_DNS" ] && [ -d "/tmp/dnsmasq.d/" ];then
SDNS=`echo $CISCO_SPLIT_DNS|sed 's/,/\n/g'`
- DNSMASQ_FILE="/tmp/dnsmasq.d/openconnect.$TUNDEV"
- rm -f $DNSMASQ_FILE
echo "$SDNS" | while read i; do
if [ -n "$INTERNAL_IP4_DNS" ];then
for dns in "$INTERNAL_IP4_DNS";do
@@ -110,7 +110,19 @@ do_connect() {
proto_add_dns_server "$dns"
done
fi
- [ -n "$CISCO_DEF_DOMAIN" ] && proto_add_dns_search "$CISCO_DEF_DOMAIN"
+ if [ -n "$CISCO_DEF_DOMAIN" ];then
+ if [ -n "$INTERNAL_IP4_DNS" ];then
+ for dns in "$INTERNAL_IP4_DNS";do
+ echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
+ done
+ fi
+ if [ -n "$INTERNAL_IP6_DNS" ];then
+ for dns in "$INTERNAL_IP6_DNS";do
+ echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
+ done
+ fi
+ proto_add_dns_search "$CISCO_DEF_DOMAIN"
+ fi
fi
if [ -n "$CISCO_SPLIT_INC" ]; then