网口默认up
This commit is contained in:
+20
-16
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/sh
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: networking
|
# Provides: networking
|
||||||
# Required-Start: mountvirtfs $local_fs
|
# Required-Start: mountvirtfs $local_fs
|
||||||
@@ -56,21 +56,25 @@ check_network_swap() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_eth0_dhcp() {
|
start_eth0_dhcp() {
|
||||||
local retry=0
|
# eth0 and netcond are initialized asynchronously on this platform.
|
||||||
|
# Keep reasserting the link state during late boot so a delayed driver
|
||||||
while [ ! -d /sys/class/net/eth0 ] && [ $retry -lt 10 ]; do
|
# probe or netcond cannot leave the interface down. Addressing remains
|
||||||
sleep 1
|
# dynamic and is handled by udhcpc.
|
||||||
retry=$((retry + 1))
|
(
|
||||||
done
|
retry=0
|
||||||
|
while [ $retry -lt 60 ]; do
|
||||||
[ -d /sys/class/net/eth0 ] || return 0
|
if [ -d /sys/class/net/eth0 ]; then
|
||||||
|
ip link set eth0 up >/dev/null 2>&1 || \
|
||||||
ip link set eth0 up 2>/dev/null || ifconfig eth0 up 2>/dev/null || true
|
ifconfig eth0 up >/dev/null 2>&1 || true
|
||||||
|
if command -v udhcpc >/dev/null 2>&1 &&
|
||||||
if command -v udhcpc >/dev/null 2>&1 &&
|
! ps | grep "[u]dhcpc .*eth0" >/dev/null 2>&1; then
|
||||||
! ps | grep "[u]dhcpc .*eth0" >/dev/null 2>&1; then
|
udhcpc -i eth0 -b -R >/dev/null 2>&1 &
|
||||||
udhcpc -i eth0 -b -R >/dev/null 2>&1 &
|
fi
|
||||||
fi
|
fi
|
||||||
|
retry=$((retry + 1))
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
) &
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
|||||||
Reference in New Issue
Block a user