X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Ffiles%2Fetc%2Frc.local%2FFAISERVER;h=2c255cced71b0a12ee807b48ea7c75cdce854852;hb=490334746631a6c956eee47947f3ab8f8a451666;hp=e70fae952205b7e5689cd19881a7e745060faa04;hpb=f8e7e925a0eba5b0091354ccf26842bcfda9b84e;p=automated-distro-installer diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER index e70fae9..2c255cc 100755 --- a/fai/config/files/etc/rc.local/FAISERVER +++ b/fai/config/files/etc/rc.local/FAISERVER @@ -10,8 +10,10 @@ GREEN='\E[32m' set -o pipefail # setup network -nic=$(awk '/iface/ {print $2}' /etc/network/interfaces |egrep -v ^lo) -ifup $nic +nic=$(cat /etc/network/interfaces /etc/network/interfaces.d/* 2>/dev/null | awk '$1 == "iface" && $2 != "lo" {print $2; exit}') +if [ -n "$nic" ]; then + ifup $nic +fi # regenerate ssh_host keys ls /etc/ssh/ssh_host_* > /dev/null if [ $? -ne 0 ]; then @@ -33,7 +35,9 @@ if [ ! -d "$FAI_CONFIGDIR/class" ]; then mkdir -p $FAI_CONFIGDIR cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR ainsl /srv/fai/config/class/FAIBASE.var "^LOGUSER=fai" - myip=$(ip addr show up| grep -P -o '(?<=inet )[^/]+' | 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%/*} echo "APTPROXY=http://$myip:3142" >> /srv/fai/config/class/DEBIAN.var fi # set the LOGUSER, wo we get all the logs from our install clients @@ -79,7 +83,7 @@ EOF fai-chboot -o default # create a template for booting the installation -fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config buster.tmpl +fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config bullseye.tmpl # Since we do not know the MAC address, our DHCP cannot provide the hostname. # Therefore we do explicitly set the hostname