]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/net/common/ipv4-static
OpenSwan-Build-Fix.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / net / common / ipv4-static
index 2c8aec13865e6254f6bfc7c498e3f2126be98e70..62a131037f667c08e88a704dee1dfe6628dd94ee 100644 (file)
@@ -7,6 +7,7 @@
 # Authors     : Nathan Coulson - nathan@linuxfromscratch.org
 #               Kevin P. Fleming - kpfleming@linuxfromscratch.org
 #               Michael Tremer - mitch@ipfire.org
+#               Maniacikarus - Maniacikarus@ipfire.org
 #
 # Version     : 00.00
 #
@@ -43,6 +44,17 @@ case "${2}" in
                        if ip route | grep -q default; then
                                boot_mesg "Gateway already setup; skipping." ${WARNING}
                                echo_warning
+                       elif [ "${CONFIG_TYPE}" == "0" ] || [ "${CONFIG_TYPE}" == "" ] && [ "${GATEWAY}" != "" ]; then
+                               boot_mesg "Setting up default gateway for green only..."
+                               ip route add default via ${GATEWAY} dev ${1}
+                               evaluate_retval
+                                if [ "${DNS1}" != "" ];then
+                                       boot_mesg "Registering DNS Server for green only..."
+                                       echo "nameserver $DNS1" > /etc/resolv.conf
+                                fi
+                                if [ "${DNS2}" != "" ];then
+                                 echo "nameserver $DNS2" >> /etc/resolv.conf
+                                fi
                        else
                                boot_mesg "Setting up default gateway..."
                                echo $DEFAULT_GATEWAY > /var/ipfire/red/remote-ipaddress
@@ -63,7 +75,12 @@ case "${2}" in
                        ip route del default
                        evaluate_retval
                fi
-       
+               
+               if [ "${CONFIG_TYPE}" == "0" ] || [ "${CONFIG_TYPE}" == "" ]; then
+                       boot_mesg "Restoring default DNS Proxy Adress in resolv.conf..."
+                       echo "nameserver 127.0.0.1" > /etc/resolv.conf
+    fi
+       
                boot_mesg "Removing IPv4 address ${ADDRESS} from the ${1} interface..."
                ip addr del ${args} dev ${1}
                evaluate_retval