From cbe1502835f21507a3a2bdcd63e8bfac8a825575 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 20 Jul 2024 21:04:26 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=89=BE=E4=B8=8D=E5=88=B0=E7=BD=91?= =?UTF-8?q?=E5=8D=A1=E5=88=99=E4=B8=AD=E6=96=AD=E7=BD=91=E7=BB=9C=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alpine-network.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/alpine-network.sh b/alpine-network.sh index 066f2d1..4535e87 100644 --- a/alpine-network.sh +++ b/alpine-network.sh @@ -157,6 +157,14 @@ flush_ipv6_config() { 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 # debian / kali if [ -f /usr/share/debconf/confmodule ]; then @@ -164,7 +172,6 @@ if [ -f /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule # 开启 ethx + dhcpv4/v6 - ethx=$(get_ethx) ip link set dev "$ethx" up sleep 1 db_progress STEP 1 @@ -199,8 +206,6 @@ EOF db_progress INFO netcfg/link_detect_progress else # alpine - ethx=$(get_ethx) - echo "$ethx" ip link set dev "$ethx" up sleep 1 udhcpc -i "$ethx" -f -q -n || true