3 # network This starts and stops network.
6 PATH=/sbin:/bin:/usr/bin:/usr/sbin
8 # Source function library.
9 . /etc/init.d/functions
12 [ -f "/etc/sysconfig/network" ] && . /etc/sysconfig/network
15 cd /etc/sysconfig/network-scripts
17 interfaces=`ls ifcfg-*`
19 # See how we were called.
22 for i in $interfaces; do
24 ifconfig ${DEVICE} ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK} up
25 if [ "$?" = "0" ]; then
26 echo " bring up $DEVICE successfully"
28 echo " fail to bring up $DEVICE."
32 route add default gw ${GATEWAY}
36 for i in $interfaces; do
38 ifconfig ${DEVICE} down
47 echo $"Usage: $0 {start|stop|restart}"