cvs commit: LFS/bootscripts/lfs/sysconfig/network-devices/services static

nathan at linuxfromscratch.org nathan at linuxfromscratch.org
Tue May 4 15:25:48 PDT 2004


nathan      04/05/04 16:25:48

  Modified:    bootscripts CHANGELOG
               bootscripts/lfs/init.d network
               bootscripts/lfs/sysconfig/network-devices/services static
  Log:
  Moved configuration of gateway's around
  
  Revision  Changes    Path
  1.68      +2 -0      LFS/bootscripts/CHANGELOG
  
  Index: CHANGELOG
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/CHANGELOG,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- CHANGELOG	4 May 2004 22:15:03 -0000	1.67
  +++ CHANGELOG	4 May 2004 22:25:48 -0000	1.68
  @@ -4,6 +4,8 @@
   	* chgrp's udev, /var/run/udev, if udev is a valid group, suggested by
   	  Zack
   	* Moved udev from contrib to lfs
  +	* Moved GATEWAY setup from /etc/rc.d/init.d/network to
  +	  /etc/sysconfig/network-devices/services/static
   
   n/a - April 30, 2004
   
  
  
  
  1.2       +4 -0      LFS/bootscripts/lfs/init.d/network
  
  Index: network
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/lfs/init.d/network,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- network	17 Mar 2004 22:24:23 -0000	1.1
  +++ network	4 May 2004 22:25:48 -0000	1.2
  @@ -25,6 +25,8 @@
   		# Setup the Gateway
   		if [ "$GATEWAY" != "" ]
   		then
  +			echo -n "Warning, setting gateway in "
  +			echo "/etc/sysconfig/network is depreciated"
   			echo "Setting up default gateway..."
   			route add default gateway $GATEWAY metric 1 \
   				dev $GATEWAY_IF
  @@ -35,6 +37,8 @@
   	stop)
   		if [ "$GATEWAY" != "" ]
   		then
  +			echo -n "Warning, setting gateway in "
  +			echo "/etc/sysconfig/network is depreciated"
   			echo "Removing default gateway..."
   			route del -net default
   			evaluate_retval
  
  
  
  1.2       +17 -0     LFS/bootscripts/lfs/sysconfig/network-devices/services/static
  
  Index: static
  ===================================================================
  RCS file: /home/cvsroot/LFS/bootscripts/lfs/sysconfig/network-devices/services/static,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- static	17 Mar 2004 22:24:24 -0000	1.1
  +++ static	4 May 2004 22:25:48 -0000	1.2
  @@ -32,9 +32,26 @@
   		echo "Bringing up the $1 interface..."
   		ifconfig $1 $IP netmask $NETMASK broadcast $BROADCAST
   		evaluate_retval
  +
  +		if [ -n "$GATEWAY" ]; then
  +			if route -n | grep -q '^0\.0\.0\.0'; then
  +				echo "Gateway already setup; skipping..."
  +				print_status warning
  +			else
  +				echo "Setting up default gateway..."
  +				route add default gateway $GATEWAY metric 1 dev $1
  +				evaluate_retval
  +			fi
  +		fi
   	;;
   
   	down)
  +		if [ -n "$GATEWAY" ]; then
  +			echo "Removing default gateway..."
  +			route del -net default
  +			evaluate_retval
  +		fi
  +
   		echo "Bringing down the $1 interface..."
   		ifconfig $1 down
   		evaluate_retval
  
  
  



More information about the lfs-book mailing list