From 6e55031041c0040186e2b83a936a16f49a0974d0 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Fri, 4 May 2018 16:40:37 +0200 Subject: [SSPS] static files: netsetup now accepts stuff like ens160 etc. --- satellit_installer/static_files/netsetup | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/satellit_installer/static_files/netsetup b/satellit_installer/static_files/netsetup index 33af46c..6616c50 100755 --- a/satellit_installer/static_files/netsetup +++ b/satellit_installer/static_files/netsetup @@ -2,11 +2,13 @@ DATUM=$(date +%Y%m%d_%H%M%S) INTERFACES="/etc/network/interfaces" +ETHALIAS=$( ifconfig -a | grep -oEm1 '^e\w+' ) RESOLV="/etc/resolv.conf" HOSTNAMEFILE="/etc/hostname" SKRIPT=$(readlink -f "$0") ERR=0 + write_banner() { echo echo "Dieses Skript konfiguriert das Netzwerk-Interface." @@ -18,7 +20,7 @@ write_banner() { detect_config() { - if grep -q -E "^[[:space:]]*iface[[:space:]]+eth0[[:space:]]+inet[[:space:]]+dhcp" "$INTERFACES"; then + if grep -q -E "^[[:space:]]*iface[[:space:]]+${ETHALIAS}[[:space:]]+inet[[:space:]]+dhcp" "$INTERFACES"; then # dhcp detected, we presume TYPE=dhcp-basierte WUNSCH=statische @@ -97,8 +99,8 @@ write_config_static() { iface lo inet loopback # Primary network interface - auto eth0 - iface eth0 inet static + auto $ETHALIAS + iface $ETHALIAS inet static address $IPADRESS gateway $GATEWAY netmask $NETMASK @@ -127,8 +129,8 @@ write_config_dyn() { iface lo inet loopback # Primary network interface - auto eth0 - iface eth0 inet dhcp + auto $ETHALIAS + iface $ETHALIAS inet dhcp # Leaving /etc/resolv alone; pump/dhclient/whatever will take care of that. HIER } -- cgit v1.2.3-55-g7522