#! /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
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"