update to db59a1a2dd 2019-03-07
[automated-distro-installer] / fai / config / scripts / FAISERVER / 10-conffiles
index 4bf2ed235583756b013a1fdd6aabb675281efe85..578255f8fc8a4d58098f9367891309df2f2e2302 100755 (executable)
@@ -1,10 +1,9 @@
 #! /bin/bash
 
-fcopy -Bvr /etc/fai
-fcopy -Bv /etc/fai/apt/sources.list /etc/dhcp/dhcpd.conf
-fcopy -v /etc/rc.local
+fcopy -BvrS /etc/fai
+fcopy -BvS /etc/dhcp/dhcpd.conf
 
-if [ $FAI_ACTION = "install" ]; then
+if [ $FAI_ACTION = "install" -o $FAI_ACTION = "dirinstall" ] ; then
 
     # use the same sources.list for the server itself and the clients
     cp -a $target/etc/fai/apt $target/etc/
@@ -19,7 +18,7 @@ if [ $FAI_ACTION = "install" ]; 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)
+    myip=$(ip addr show up| grep -P -o '(?<=inet )[^/]+' | grep -v 127.0.0.1)
     ainsl /etc/hosts "$myip faiserver"  # that's me
     ainsl /etc/hosts "192.168.33.100 demohost"
     ainsl /etc/hosts "192.168.33.101 xfcehost"
@@ -30,7 +29,9 @@ if [ $FAI_ACTION = "install" ]; then
     ainsl -v /etc/apt-cacher-ng/acng.conf "ReuseConnections: 0"
 
     # copy base file for faster building of nfsroot
-    cp -p /var/tmp/base.tar.xz $target/var/tmp
+    if [ -f /var/tmp/base.tar.xz ]; then
+       cp -p /var/tmp/base.tar.xz $target/var/tmp
+    fi
 
     if [ -d /media/mirror/pool ]; then
        mkdir $target/var/cache/apt-cacher-ng/_import
@@ -41,6 +42,6 @@ if [ $FAI_ACTION = "install" ]; then
     # copy basefiles from CD to config space
     if [ -d $FAI/basefiles ]; then
        mkdir -p $target/srv/fai/config/basefiles
-       cp -vp $FAI/basefiles/*.tar.* $target/srv/fai/config/basefiles 2>/dev/null
+       cp -vp $FAI/basefiles/*.tar.* $target/srv/fai/config/basefiles 2>/dev/null || true
     fi
 fi