Magellan Linux

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

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

revision 1665 by niro, Fri Jan 20 23:01:04 2012 UTC revision 2305 by niro, Thu Jan 2 13:28:42 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    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     sleep 0.1
19     done
20    
21     return 0
22    }
23    
24  # read values from files  # read values from files
25  read_value()  read_value()
26  {  {
# Line 167  config_wireless_wpa() Line 183  config_wireless_wpa()
183   return 1   return 1
184   fi   fi
185    
186   if [ ! -x /sbin/wpa_supplicant ]   if [ ! -x $(type -P wpa_supplicant) ]
187   then   then
188   echo "WPA: wpa_supplicant not installed. Aborting setup."   echo "WPA: wpa_supplicant not installed. Aborting setup."
189   return 1   return 1
# Line 177  config_wireless_wpa() Line 193  config_wireless_wpa()
193   [[ -f /etc/conf.d/wpa_supplicant ]] && source /etc/conf.d/wpa_supplicant   [[ -f /etc/conf.d/wpa_supplicant ]] && source /etc/conf.d/wpa_supplicant
194    
195   # check the configuration   # check the configuration
196   [[ -z ${WIRELESS_WPA_CONFIG} ]] && WIRELESS_WPA_CONFIG=/etc/wpa_supplicant.auto   [[ -z ${WIRELESS_WPA_CONFIG} ]] && WIRELESS_WPA_CONFIG=/etc/wpa_supplicant/wpa_supplicant.auto
197   [[ -z ${WIRELESS_WPA_SKEL} ]] && WIRELESS_WPA_SKEL=/etc/conf.d/wpa_supplicant.skel   [[ -z ${WIRELESS_WPA_SKEL} ]] && WIRELESS_WPA_SKEL=/etc/conf.d/wpa_supplicant.skel
198    
199   # use wext as default driver, do not abort here anymore   # use wext as default driver, do not abort here anymore
# Line 328  config_bridge_devices() Line 344  config_bridge_devices()
344   fi   fi
345    
346   # first check for brctl   # first check for brctl
347   if [[ -z $(which brctl) ]]   if [[ -z $(type -P brctl) ]]
348   then   then
349   echo "brctl not found! Please install 'net-misc/bridge-utils'."   echo "brctl not found! Please install 'net-misc/bridge-utils'."
350   return 1   return 1
# Line 428  networking_start() Line 444  networking_start()
444   source /etc/conf.d/net.${iface} || exit 1   source /etc/conf.d/net.${iface} || exit 1
445   checkconfig   checkconfig
446    
447     # wait until the device is created
448     wait_online 5 "${iface}" || { echo "device '${iface}' does not exist"; continue; }
449    
450   # setup mac   # setup mac
451   if [[ -n ${FORCE_MAC_TO} ]]   if [[ -n ${FORCE_MAC_TO} ]]
452   then   then
# Line 441  networking_start() Line 460  networking_start()
460   fi   fi
461    
462   # now configure wireless_extensions   # now configure wireless_extensions
463   [ -x /usr/sbin/iwconfig ] && setup_wireless_extensions "${iface}"   [ -x $(type -P iwconfig) ] && setup_wireless_extensions "${iface}"
464    
465   # activate the interface   # activate the interface
466   ifconfig "${iface}" up   ifconfig "${iface}" up

Legend:
Removed from v.1665  
changed lines
  Added in v.2305