From 3bf44504a62259f24221fcaabb4b48e4f4a6a344 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Fri, 25 Aug 2023 13:39:48 +0800 Subject: [PATCH] =?UTF-8?q?alpine:=20=E4=BC=98=E5=8C=96=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/trans.sh b/trans.sh index 0ecbdec..dc31e2a 100644 --- a/trans.sh +++ b/trans.sh @@ -273,28 +273,25 @@ install_alpine() { sed -i '/^slaac private/s/^/#/' /etc/dhcpcd.conf sed -i '/^#slaac hwaddr/s/^#//' /etc/dhcpcd.conf - # 生成 lo 配置 + # 生成 lo配置 + eth0头部 cat </etc/network/interfaces auto lo iface lo inet loopback + +auto eth0 EOF # 生成 ipv4 配置 - echo >>/etc/network/interfaces if [ "$(get_netconf dhcpv4)" = 1 ]; then # dhcpv4 - cat <>/etc/network/interfaces -auto eth0 -iface eth0 inet dhcp -EOF + echo "iface eth0 inet dhcp" >>/etc/network/interfaces else # static ipv4_addr=$(get_netconf ipv4_addr) ipv4_gateway=$(get_netconf ipv4_gateway) if [ -n "$ipv4_addr" ]; then cat <>/etc/network/interfaces -auto eth0 -iface eth0 inet4 static +iface eth0 inet static address $ipv4_addr gateway $ipv4_gateway EOF