mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
core: 找不到网卡则中断网络配置
This commit is contained in:
parent
6dfa1c53c4
commit
cbe1502835
@ -157,6 +157,14 @@ flush_ipv6_config() {
|
|||||||
ip -6 route flush dev "$ethx"
|
ip -6 route flush dev "$ethx"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ethx=$(get_ethx)
|
||||||
|
if [ -z "$ethx" ]; then
|
||||||
|
echo "Not found network card: $mac_addr"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Configuring $ethx ($mac_addr)"
|
||||||
|
|
||||||
# dhcp v4 /v6
|
# dhcp v4 /v6
|
||||||
# debian / kali
|
# debian / kali
|
||||||
if [ -f /usr/share/debconf/confmodule ]; then
|
if [ -f /usr/share/debconf/confmodule ]; then
|
||||||
@ -164,7 +172,6 @@ if [ -f /usr/share/debconf/confmodule ]; then
|
|||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
# 开启 ethx + dhcpv4/v6
|
# 开启 ethx + dhcpv4/v6
|
||||||
ethx=$(get_ethx)
|
|
||||||
ip link set dev "$ethx" up
|
ip link set dev "$ethx" up
|
||||||
sleep 1
|
sleep 1
|
||||||
db_progress STEP 1
|
db_progress STEP 1
|
||||||
@ -199,8 +206,6 @@ EOF
|
|||||||
db_progress INFO netcfg/link_detect_progress
|
db_progress INFO netcfg/link_detect_progress
|
||||||
else
|
else
|
||||||
# alpine
|
# alpine
|
||||||
ethx=$(get_ethx)
|
|
||||||
echo "$ethx"
|
|
||||||
ip link set dev "$ethx" up
|
ip link set dev "$ethx" up
|
||||||
sleep 1
|
sleep 1
|
||||||
udhcpc -i "$ethx" -f -q -n || true
|
udhcpc -i "$ethx" -f -q -n || true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user