Magellan Linux

Diff of /trunk/initscripts/systemd/units/scripts/network.sh

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

revision 2063 by niro, Thu Feb 21 08:27:48 2013 UTC revision 2382 by niro, Tue Jan 7 12:02:04 2014 UTC
# Line 5  Line 5 
5  # get default settings  # get default settings
6  source /etc/conf.d/network  source /etc/conf.d/network
7    
8    iface_wait_online()
9    {
10     local timeout="$1"
11     local iface="$2"
12    
13     (( timeout *= 10 ))
14    
15     while [ ! -e /sys/class/net/${iface} ]
16     do
17     (( timeout-- > 0 )) || return 1
18     echo "waiting 0.1 seconds for device '${iface}' - timeout->'${timeout}'"
19     sleep 0.1
20     done
21    
22     return 0
23    }
24    
25  # read values from files  # read values from files
26  read_value()  read_value()
27  {  {
# Line 428  networking_start() Line 445  networking_start()
445   source /etc/conf.d/net.${iface} || exit 1   source /etc/conf.d/net.${iface} || exit 1
446   checkconfig   checkconfig
447    
448     # wait until the device is created
449     iface_wait_online 5 "${iface}" || { echo "device '${iface}' does not exist"; continue; }
450    
451   # setup mac   # setup mac
452   if [[ -n ${FORCE_MAC_TO} ]]   if [[ -n ${FORCE_MAC_TO} ]]
453   then   then
# Line 441  networking_start() Line 461  networking_start()
461   fi   fi
462    
463   # now configure wireless_extensions   # now configure wireless_extensions
464   [ -x /usr/sbin/iwconfig ] && setup_wireless_extensions "${iface}"   [ -x $(type -P iwconfig) ] && setup_wireless_extensions "${iface}"
465    
466   # activate the interface   # activate the interface
467   ifconfig "${iface}" up   ifconfig "${iface}" up

Legend:
Removed from v.2063  
changed lines
  Added in v.2382