Changeset f25bf53 in bootscripts-embedded for clfs/rc.d/init.d/network


Ignore:
Timestamp:
Jan 31, 2009, 10:18:40 AM (16 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
master
Children:
4230d00
Parents:
fe1b471
Message:

Formatting change to embedded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • clfs/rc.d/init.d/network

    rfe1b471 rf25bf53  
    1010
    1111if [ "$NETWORKING" != "yes" ]; then
    12         echo "Networking is disabled in /etc/network.conf"
    13         exit 0
     12  echo "Networking is disabled in /etc/network.conf"
     13  exit 0
    1414fi
    1515
    1616case "$1" in
    1717start)
    18         for i in /etc/network.d/interface.*
    19         do
    20                 if [ -r "$i" ]; then
    21                         . $i
    22                         if [ "$DHCP" = "yes" ]; then
    23                                 echo -n "Starting DHCP for interface $INTERFACE: "
    24                                 udhcpc -b -i "$INTERFACE" \
    25                                         -p "/var/run/udhcpc.$INTERFACE.pid" \
    26                                         > /dev/null
    27                         else
    28                                 echo -n "Setting up interface $INTERFACE: "
    29                                 ifconfig "$INTERFACE" "$IPADDRESS" \
    30                                         netmask "$NETMASK" \
    31                                         broadcast "$BROADCAST" up
    32                         fi
    33                         check_status
    34                 fi
    35         done
     18  for i in /etc/network.d/interface.*; do
     19    if [ -r "$i" ]; then
     20      . $i
     21      if [ "$DHCP" = "yes" ]; then
     22        echo -n "Starting DHCP for interface $INTERFACE: "
     23        udhcpc -b -i "$INTERFACE" \
     24          -p "/var/run/udhcpc.$INTERFACE.pid" \
     25          > /dev/null
     26      else
     27        echo -n "Setting up interface $INTERFACE: "
     28        ifconfig "$INTERFACE" "$IPADDRESS" \
     29          netmask "$NETMASK" \
     30          broadcast "$BROADCAST" up
     31      fi
     32        check_status
     33    fi
     34  done
    3635       
    37         if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
    38                 echo -n "Setting default route: "
    39                 route add default gw $GATEWAY
    40                 check_status
    41         fi
    42         ;;
     36  if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
     37    echo -n "Setting default route: "
     38    route add default gw $GATEWAY
     39    check_status
     40  fi
     41;;
    4342stop)
    44         if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
    45                 echo -n "Removing default route: "
    46                 route del -net 0.0.0.0
    47                 check_status
    48         fi
     43  if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
     44    echo -n "Removing default route: "
     45    route del -net 0.0.0.0
     46    check_status
     47  fi
    4948
    50         for i in /etc/network.d/interface.*
    51         do
    52                 if [ -r "$i" ]; then
    53                         . $i
    54                         echo -n "Shutting down interface $INTERFACE: "
    55                         ifconfig $INTERFACE down
    56                         check_status
    57                         if [ "$DHCP" = "yes" ]; then
    58                                 kill `cat "/var/run/udhcpc.$INTERFACE.pid"`
    59                                 sleep 1
    60                         fi
    61                 fi
    62         done
    63         ;;
     49  for i in /etc/network.d/interface.*; do
     50    if [ -r "$i" ]; then
     51    . $i
     52    echo -n "Shutting down interface $INTERFACE: "
     53    ifconfig $INTERFACE down
     54    check_status
     55    if [ "$DHCP" = "yes" ]; then
     56      kill `cat "/var/run/udhcpc.$INTERFACE.pid"`
     57      sleep 1
     58    fi
     59  fi
     60  done
     61;;
    6462restart)
    65         $0 stop
    66         $0 start
    67         ;;
     63  $0 stop
     64  $0 start
     65;;
    6866status)
    69         ifconfig
    70         route
    71         ;;
     67  ifconfig
     68  route
     69;;
    7270*)
    73         echo "Usage: $0 {start|stop|restart|status}"
    74         exit 1
     71  echo "Usage: $0 {start|stop|restart|status}"
     72  exit 1
    7573esac
Note: See TracChangeset for help on using the changeset viewer.