From 0bcdebaefcbe9106e56c9b0ae6f64ac300094ba6 Mon Sep 17 00:00:00 2001 From: Ezra Date: Tue, 14 Jun 2016 20:10:48 +0200 Subject: [PATCH] fix for script install / vm install vm ships with ens33 and regular ubuntu distro's with eth0 as default NIC --- nextcloud-startup-script.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index 26d48eb2..53733eb3 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -25,8 +25,14 @@ UNIXPASS=nextcloud fi # Set correct interface -sed -i "s|ens33|$IFACE|g" /etc/network/interfaces -service networking restart +if grep -Fxq "eth0" /etc/network/interfaces +then + sed -i "s|eth0|$IFACE|g" /etc/network/interfaces + service networking restart +else + sed -i "s|ens33|$IFACE|g" /etc/network/interfaces + service networking restart +fi # Check network echo "Testing if network is OK..."