Magellan Linux

Diff of /trunk/initscripts/sysvinit/rc/network

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1092 by niro, Wed Jul 14 11:02:11 2010 UTC revision 1165 by niro, Sun Sep 26 18:53:37 2010 UTC
# Line 81  checkconfig() Line 81  checkconfig()
81  {  {
82   if [[ -z ${NETWORKING} ]]   if [[ -z ${NETWORKING} ]]
83   then   then
84   echo "NETWORKING missing in net.${interface}, aborted"   echo "NETWORKING missing in net.${iface}, aborted"
85   exit 1   exit 1
86   fi   fi
87    
# Line 89  checkconfig() Line 89  checkconfig()
89   static)   static)
90   if [[ -z ${IP} ]]   if [[ -z ${IP} ]]
91   then   then
92   echo "IP missing in net.${interface}, aborted"   echo "IP missing in net.${iface}, aborted"
93   exit 1   exit 1
94   fi   fi
95    
96   if [[ -z ${NETMASK} ]]   if [[ -z ${NETMASK} ]]
97   then   then
98   echo -n "NETMASK missing in net.${interface}, "   echo -n "NETMASK missing in net.${iface}, "
99   echo "using 255.255.255.0"   echo "using 255.255.255.0"
100   NETMASK=255.255.255.0   NETMASK=255.255.255.0
101   fi   fi
102    
103   if [[ -z ${BROADCAST} ]]   if [[ -z ${BROADCAST} ]]
104   then   then
105   echo -n "BROADCAST missing in net.${interface}, "   echo -n "BROADCAST missing in net.${iface}, "
106   echo "using default address"   echo "using default address"
107   fi   fi
108   ;;   ;;
# Line 110  checkconfig() Line 110  checkconfig()
110   dhcp)   dhcp)
111   if [[ -z ${DHCP_PROG} ]]   if [[ -z ${DHCP_PROG} ]]
112   then   then
113   echo -n "DHCP_PROG missing in net.${interface},"   echo -n "DHCP_PROG missing in net.${iface},"
114   echo "using default programm"   echo "using default programm /sbin/dhcpcd"
115   DHCP_PROG="/sbin/dhcpcd"   DHCP_PROG="/sbin/dhcpcd"
116   fi   fi
117   [[ -z ${DHCP_START} ]] && DHCP_START="-t 10"   [[ -z ${DHCP_START} ]] && DHCP_START="-t 10"
# Line 505  networking_start() Line 505  networking_start()
505   fi   fi
506    
507   # setup /etc/resolv.conf   # setup /etc/resolv.conf
  # whipe out the old one  
  echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf  
  # include head  
  if [ -f /etc/resolv.conf.head ]  
  then  
  cat /etc/resolv.conf.head >> /etc/resolv.conf  
  else  
  echo "# /etc/resolv.conf.head can replace this line" >> /etc/resolv.conf  
  fi  
508   # add given nameserver   # add given nameserver
509   if [[ -n ${NAMESERVER} ]]   if [[ -n ${NAMESERVER} ]]
510   then   then
511   echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..."   echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..."
512    
513     # whipe out the old one
514     echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf
515     # include head
516     if [ -f /etc/resolv.conf.head ]
517     then
518     cat /etc/resolv.conf.head >> /etc/resolv.conf
519     else
520     echo "# /etc/resolv.conf.head can replace this line" >> /etc/resolv.conf
521     fi
522    
523   for dns in ${NAMESERVER}   for dns in ${NAMESERVER}
524   do   do
525   echo "nameserver ${dns}" >> /etc/resolv.conf   echo "nameserver ${dns}" >> /etc/resolv.conf
526   done   done
527    
528     # include tail
529     if [ -f /etc/resolv.conf.tail ]
530     then
531     cat /etc/resolv.conf.tail >> /etc/resolv.conf
532     else
533     echo "# /etc/resolv.conf.tail can replace this line" >> /etc/resolv.conf
534     fi
535    
536   unset NAMESERVER   unset NAMESERVER
537   fi   fi
  # include tail  
  if [ -f /etc/resolv.conf.tail ]  
  then  
  cat /etc/resolv.conf.tail >> /etc/resolv.conf  
  else  
  echo "# /etc/resolv.conf.tail can replace this line" >> /etc/resolv.conf  
  fi  
538   done   done
539    
540   # setup user routes   # setup user routes

Legend:
Removed from v.1092  
changed lines
  Added in v.1165