summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Rößler2018-05-04 16:40:37 +0200
committerChristian Rößler2018-05-04 16:40:37 +0200
commit6e55031041c0040186e2b83a936a16f49a0974d0 (patch)
treebf5fd7bba0ddf9dab8e609800bb909daa2b450bf
parent[SSPS] Fix IP detection in bashrc (diff)
downloadsetup-scripts-6e55031041c0040186e2b83a936a16f49a0974d0.tar.gz
setup-scripts-6e55031041c0040186e2b83a936a16f49a0974d0.tar.xz
setup-scripts-6e55031041c0040186e2b83a936a16f49a0974d0.zip
[SSPS] static files: netsetup now accepts stuff like ens160 etc.
-rwxr-xr-xsatellit_installer/static_files/netsetup12
1 files 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
}