dbailey: branch aadk r1060 - /branches/aadk/scripts/networking.sh

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Jun 7 09:03:20 MST 2007


Author: dbailey
Date: Thu Jun  7 11:03:19 2007
New Revision: 1060

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1060
Log:
Change how gateways are handled in WAN static ip set up 

Modified:
    branches/aadk/scripts/networking.sh

Modified: branches/aadk/scripts/networking.sh
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/scripts/networking.sh?view=diff&rev=1060&r1=1059&r2=1060
==============================================================================
--- branches/aadk/scripts/networking.sh (original)
+++ branches/aadk/scripts/networking.sh Thu Jun  7 11:03:19 2007
@@ -65,6 +65,13 @@
 cat ${INETD_CONFIG}.* > ${INETD_CONFIG}
 killall -HUP ${INETD_PROCNAME}
 
+# Delete old default gateways in the routing table 
+OLDGATEWAY=`route | grep default | grep UG |  cut -c 17-32`
+if [ "${OLDGATEWAY}" != "" ]; then
+	for i in $OLDGATEWAY; do 
+		route delete default gw $i; 
+	done
+fi
 # Setup the WAN interface.
 if [ "${DHCP_WAN}" = "on" ]; then
 	# If dhcp_wan is set from the gui
@@ -75,10 +82,10 @@
 	echo "WAN interface is ${WAN_INTERFACE} WAN IP is ${IP_WAN} WAN subnet is ${SUBNET_WAN}"
 	echo "DNS config file is ${DNS_CONFIG}"
 	ifconfig ${WAN_INTERFACE} ${IP_WAN} netmask ${SUBNET_WAN}
+	route add default gw ${GATEWAY_WAN}	 						# Add gateway to routing tables
 	echo "`cat ${DNS_CONFIG} | grep search`" > ${DNS_CONFIG}.tmp # Save the previous "search" field
 	mv ${DNS_CONFIG}.tmp ${DNS_CONFIG}
 	echo "nameserver ${DNS_WAN}" >> ${DNS_CONFIG} # Add the IP/hostname of the nameserver
-	route -n add ${GATEWAY_WAN} ${WAN_INTERFACE} # Add our default gateway for the WAN interface
 fi 
 
 # Setup the LAN interface(s).



More information about the asterisk-gui-commits mailing list