Magellan Linux

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

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

revision 931 by niro, Thu Nov 5 12:57:14 2009 UTC revision 1091 by niro, Wed Jul 14 07:29:53 2010 UTC
# Line 103  checkconfig() Line 103  checkconfig()
103   dhcp)   dhcp)
104   if [[ -z ${DHCP_PROG} ]]   if [[ -z ${DHCP_PROG} ]]
105   then   then
106   echo "DHCP_PROG missing in net.${interface}, aborted"   echo -n "DHCP_PROG missing in net.${interface},"
107   exit 1   echo "using default programm"
108     DHCP_PROG="/sbin/dhcpcd"
109   fi   fi
110     [[ -z ${DHCP_START} ]] && DHCP_START="-t 10"
111     [[ -z ${DHCP_STOP} ]] && DHCP_STOP="-k"
112   ;;   ;;
113    
114   esac   esac
# Line 361  networking_start() Line 364  networking_start()
364    
365   if [[ -z $1 ]]   if [[ -z $1 ]]
366   then   then
367   ALL_INTERFACES=$(onboot_interface_list ${network_settings}/net.*)   ALL_INTERFACES=$(onboot_interface_list ${rc_network_settings}/net.*)
368   else   else
369   if [[ -e ${network_settings}/net.$1 ]]   if [[ -e ${rc_network_settings}/net.$1 ]]
370   then   then
371   ALL_INTERFACES="$1"   ALL_INTERFACES="$1"
372   else   else
# Line 378  networking_start() Line 381  networking_start()
381   for iface in ${ALL_INTERFACES}   for iface in ${ALL_INTERFACES}
382   do   do
383   # checkconfig   # checkconfig
384   source ${network_settings}/net.${iface} || exit 1   source ${rc_network_settings}/net.${iface} || exit 1
385   checkconfig   checkconfig
386    
387   # setup mac   # setup mac
388   if [ -n "${FORCE_MAC_TO}" ]   if [[ -n ${FORCE_MAC_TO} ]]
389   then   then
390   echo -e ${COLOREDSTAR}"Faking MAC to ${FORCE_MAC_TO} for ${COLBLUE}${iface}${COLDEFAULT} ... "   echo -e ${COLOREDSTAR}"Faking MAC to ${FORCE_MAC_TO} for ${COLBLUE}${iface}${COLDEFAULT} ... "
391   ifconfig "${iface}" hw ether "${FORCE_MAC_TO}"   ifconfig "${iface}" hw ether "${FORCE_MAC_TO}"
# Line 409  networking_start() Line 412  networking_start()
412   ${CURS_UP}   ${CURS_UP}
413   ${SET_WWCOL}   ${SET_WWCOL}
414   echo "[DHCP]"   echo "[DHCP]"
415   loadproc ${DHCP_PROG} ${DHCP_START} "${iface}"   loadproc "${DHCP_PROG}" "${DHCP_START}" "${iface}"
416   ;;   ;;
417   static|STATIC)   static|STATIC)
418   ${CURS_UP}   ${CURS_UP}
# Line 431  networking_start() Line 434  networking_start()
434   fi   fi
435    
436   # setup /etc/resolv.conf   # setup /etc/resolv.conf
437     # whipe out the old one
438     echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf
439     # include head
440     if [ -f /etc/resolv.conf.head ]
441     then
442     cat /etc/resolv.conf.head >> /etc/resolv.conf
443     else
444     echo "# /etc/resolv.conf.head can replace this line" >> /etc/resolv.conf
445     fi
446     # add given nameserver
447   if [[ -n ${NAMESERVER} ]]   if [[ -n ${NAMESERVER} ]]
448   then   then
449   echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..."   echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..."
450    
  # whipe out the old one  
  echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf  
451   for dns in ${NAMESERVER}   for dns in ${NAMESERVER}
452   do   do
453   echo "nameserver ${dns}" >> /etc/resolv.conf   echo "nameserver ${dns}" >> /etc/resolv.conf
# Line 444  networking_start() Line 455  networking_start()
455    
456   unset NAMESERVER   unset NAMESERVER
457   fi   fi
458     # include tail
459     if [ -f /etc/resolv.conf.tail ]
460     then
461     cat /etc/resolv.conf.tail >> /etc/resolv.conf
462     else
463     echo "# /etc/resolv.conf.tail can replace this line" >> /etc/resolv.conf
464     fi
465   done   done
466    
467   # setup user routes   # setup user routes
# Line 454  networking_stop() Line 472  networking_stop()
472  {  {
473   if [[ -z $1 ]]   if [[ -z $1 ]]
474   then   then
475   ALL_INTERFACES=$(onboot_interface_list ${network_settings}/net.*)   ALL_INTERFACES=$(onboot_interface_list ${rc_network_settings}/net.*)
476   else   else
477   if [[ -e ${network_settings}/net.$1 ]]   if [[ -e ${rc_network_settings}/net.$1 ]]
478   then   then
479   ALL_INTERFACES="$1"   ALL_INTERFACES="$1"
480   else   else
# Line 470  networking_stop() Line 488  networking_stop()
488   # get list of all devices   # get list of all devices
489   for iface in ${ALL_INTERFACES}   for iface in ${ALL_INTERFACES}
490   do   do
491   source ${network_settings}/net.${iface} || exit 1   source ${rc_network_settings}/net.${iface} || exit 1
492   checkconfig   checkconfig
493    
494   if [[ -n ${GATEWAY} ]]   if [[ -n ${GATEWAY} ]]

Legend:
Removed from v.931  
changed lines
  Added in v.1091