vpnc-scripts: Fix handling of multiple VPN DNS servers 2157/head
authorAleksandar Radovanovic <biblbroks@sezampro.rs>
Sun, 20 Dec 2015 14:28:24 +0000 (14:28 +0000)
committerAleksandar Radovanovic <biblbroks@sezampro.rs>
Sun, 20 Dec 2015 14:48:59 +0000 (14:48 +0000)
Fix for #2116 - $INTERNAL_IP{4,6}_DNS variables are not word-split correctly when containing more than one DNS server.

Signed-off-by: Aleksandar Radovanovic <biblbroks@sezampro.rs>
net/vpnc-scripts/files/vpnc-script

index 7af5074d98636f85d7024403961773f39d94c840..5575c3cdab74128321b10c798285cff96141ab05 100755 (executable)
@@ -91,12 +91,12 @@ do_connect() {
                                continue
                        fi
                        if [ -n "$INTERNAL_IP4_DNS" ];then
-                               for dns in "$INTERNAL_IP4_DNS";do
+                               for dns in $INTERNAL_IP4_DNS;do
                                        echo "server=/$i/$dns" >> $DNSMASQ_FILE
                                done
                        fi
                        if [ -n "$INTERNAL_IP6_DNS" ];then
-                               for dns in "$INTERNAL_IP6_DNS";do
+                               for dns in $INTERNAL_IP6_DNS;do
                                        echo "server=/$i/$dns" >> $DNSMASQ_FILE
                                done
                        fi
@@ -105,23 +105,23 @@ do_connect() {
                /etc/init.d/dnsmasq restart
        else
                if [ -n "$INTERNAL_IP4_DNS" ];then
-                       for dns in "$INTERNAL_IP4_DNS";do
+                       for dns in $INTERNAL_IP4_DNS;do
                                proto_add_dns_server "$dns"
                        done
                fi
                if [ -n "$INTERNAL_IP6_DNS" ];then
-                       for dns in "$INTERNAL_IP6_DNS";do
+                       for dns in $INTERNAL_IP6_DNS;do
                                proto_add_dns_server "$dns"
                        done
                fi
                if [ -n "$CISCO_DEF_DOMAIN" ] && [ "$CISCO_DEF_DOMAIN" != "$LOCAL_DOMAIN" ];then
                        if [ -n "$INTERNAL_IP4_DNS" ];then
-                               for dns in "$INTERNAL_IP4_DNS";do
+                               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
+                               for dns in $INTERNAL_IP6_DNS;do
                                        echo "server=/$CISCO_DEF_DOMAIN/$dns" >> $DNSMASQ_FILE
                                done
                        fi