update to 72d79e141d3aaf430bb44f6036a2980f3f5865bd
[automated-distro-installer] / fai / config / scripts / FAISERVER / 10-conffiles
index de17f53c407d7345494a4a53064402fa0e0b2752..92b17fc87d6c40d3a2f90f7c8367db6b351494aa 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/bash
 
-fcopy -Bvr /etc/fai
-fcopy -Bv /etc/fai/apt/sources.list /etc/dhcp/dhcpd.conf
+fcopy -BvrS /etc/fai
+fcopy -BvS /etc/dhcp/dhcpd.conf
 
 if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
 
@@ -18,7 +18,9 @@ if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
     ainsl -av /etc/apt/apt.conf.d/02proxy 'Acquire::http::Proxy "http://127.0.0.1:3142";'
 
     # create some host entries
-    myip=$(ip addr show up| grep -w inet | cut -d t -f 2 | cut -d ' ' -f 2 | cut -d / -f 1 | grep -v 127.0.0.1)
+    _nic=$(ip route | awk '/^default/ {print $5}'|head -1)
+    myip=$(ip -br ad sh $_nic | awk '{print $3}')
+    myip=${myip%/*}
     ainsl /etc/hosts "$myip faiserver"  # that's me
     ainsl /etc/hosts "192.168.33.100 demohost"
     ainsl /etc/hosts "192.168.33.101 xfcehost"