Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.76 KB | None | 0 0
  1.   start)
  2.     [ "$EUID" != "0" ] && exit 4
  3.     rc=0
  4.     # IPv6 hook (pre IPv4 start)
  5.     if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then
  6.         /etc/sysconfig/network-scripts/init.ipv6-global start pre
  7.     fi
  8.  
  9.     apply_sysctl
  10.  
  11.     # bring up loopback interface
  12.     action $"Bringing up loopback interface: " ./ifup ifcfg-lo
  13.  
  14.     case "$VLAN" in
  15.       yes)
  16.         if [ ! -d /proc/net/vlan ] && ! modprobe 8021q >/dev/null 2>&1 ; then
  17.         net_log $"No 802.1Q VLAN support available in kernel."
  18.         fi
  19.         ;;
  20.     esac
  21.  
  22.     vlaninterfaces=""
  23.     xdslinterfaces=""
  24.     bridgeinterfaces=""
  25.  
  26.     # bring up all other interfaces configured to come up at boot time
  27.     for i in $interfaces; do
  28.         unset DEVICE TYPE SLAVE
  29.         eval $(LANG=C fgrep "DEVICE=" ifcfg-$i)
  30.         eval $(LANG=C fgrep "TYPE=" ifcfg-$i)
  31.         eval $(LANG=C fgrep "SLAVE=" ifcfg-$i)
  32.  
  33.         if [ -z "$DEVICE" ] ; then DEVICE="$i"; fi
  34.  
  35.         if [ "$SLAVE" = "yes" ]; then
  36.             continue
  37.         fi
  38.  
  39.         if [ "$TYPE" = "xDSL" ]; then
  40.                 xdslinterfaces="$xdslinterfaces $i"
  41.             continue
  42.         fi
  43.  
  44.         if [ "$TYPE" = "Bridge" ]; then
  45.                 bridgeinterfaces="$bridgeinterfaces $i"
  46.             continue
  47.         fi
  48.  
  49.         if [ "${DEVICE%%.*}" != "$DEVICE"  -o  "${DEVICE##vlan}" != "$DEVICE" ] ; then
  50.             vlaninterfaces="$vlaninterfaces $i"
  51.             continue
  52.         fi
  53.  
  54.         if LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i > /dev/null ; then
  55.                 # this loads the module, to preserve ordering
  56.             is_available $i
  57.             continue
  58.         fi
  59.         # If we're in confirmation mode, get user confirmation.
  60.         if [ -f /var/run/confirm ]; then
  61.             confirm $i
  62.             test $? = 1 && continue
  63.         fi
  64.         action $"Bringing up interface $i: " ./ifup $i boot
  65.         [ $? -ne 0 ] && rc=1
  66.     done
  67.  
  68.     # Bring up xDSL and VPN interfaces
  69.     for i in $vlaninterfaces $bridgeinterfaces $xdslinterfaces ; do
  70.             if ! LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then
  71.         # If we're in confirmation mode, get user confirmation.
  72.         if [ -f /var/run/confirm ]; then
  73.             confirm $i
  74.             test $? = 1 && continue
  75.         fi
  76.         action $"Bringing up interface $i: " ./ifup $i boot
  77.         [ $? -ne 0 ] && rc=1
  78.         fi
  79.         done
  80.  
  81.     # Add non interface-specific static-routes.
  82.     if [ -f /etc/sysconfig/static-routes ]; then
  83.        grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
  84.               /sbin/route add -$args
  85.        done
  86.     fi
  87.     # Add non interface-specific static arp entries.
  88.     if [ -f /etc/ethers ]; then
  89.         /sbin/arp -f /etc/ethers
  90.     fi
  91.  
  92.     # IPv6 hook (post IPv4 start)
  93.     if [ -x /etc/sysconfig/network-scripts/init.ipv6-global ]; then
  94.         /etc/sysconfig/network-scripts/init.ipv6-global start post
  95.     fi
  96.     # Run this again to catch any interface-specific actions
  97.     apply_sysctl
  98.  
  99.         touch /var/lock/subsys/network
  100.  
  101.     [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY}
  102.         ;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement