# Authors : Nathan Coulson - nathan@linuxfromscratch.org
# Kevin P. Fleming - kpfleming@linuxfromscratch.org
# Michael Tremer - mitch@ipfire.org
+# Maniacikarus - Maniacikarus@ipfire.org
#
# Version : 00.00
#
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
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