update to 72d79e141d3aaf430bb44f6036a2980f3f5865bd
[automated-distro-installer] / fai / config / files / etc / rc.local / FAISERVER
index fddf54aae51e8b8687687efe38a9a549afbda86a..2c255cced71b0a12ee807b48ea7c75cdce854852 100755 (executable)
@@ -35,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
@@ -81,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