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 |
{ |
{ |
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 |