2 # Begin $rc_base/init.d/network - Network Control Script
4 # Based on ethnet script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
7 source /etc
/sysconfig
/rc
9 source /etc
/sysconfig
/network
13 for file in $
(grep -il "ONBOOT=yes" $network_devices/ifconfig.
*)
15 interface
=$
(basename $file |
sed s
/ifconfig.
//)
19 $network_devices/ifup
$interface
24 if [ "$GATEWAY" != "" ]
26 echo "Setting up default gateway..."
27 route add default gateway
$GATEWAY metric
1 \
34 if [ "$GATEWAY" != "" ]
36 echo "Removing default gateway..."
37 route del
-net default
41 for file in $
(grep -il "ONBOOT=yes" $network_devices/ifconfig.
*)
43 interface
=$
(basename $file |
sed s
/ifconfig.
//)
47 $network_devices/ifdown
$interface
60 echo "Usage: $0 {start|stop|restart}"
65 # End /etc/rc.d/init.d/network