X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Ffiles%2Fetc%2Frc.local%2FFAISERVER;h=e70fae952205b7e5689cd19881a7e745060faa04;hb=78a1427fc167ccee73d448054a9c40c19d737ed3;hp=8bbfd291f4edcaa084d06b65a72a31a3f2908696;hpb=da61a304a10de72288782a9d872769fe44576f50;p=automated-distro-installer diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER index 8bbfd29..e70fae9 100755 --- a/fai/config/files/etc/rc.local/FAISERVER +++ b/fai/config/files/etc/rc.local/FAISERVER @@ -10,7 +10,7 @@ GREEN='\E[32m' set -o pipefail # setup network -nic=$(grep iface /etc/network/interfaces| awk '{print $2}'|egrep -v ^lo) +nic=$(awk '/iface/ {print $2}' /etc/network/interfaces |egrep -v ^lo) ifup $nic # regenerate ssh_host keys ls /etc/ssh/ssh_host_* > /dev/null @@ -18,7 +18,7 @@ if [ $? -ne 0 ]; then dpkg-reconfigure -fnoninteractive openssh-server fi sleep 8 -[ -x /etc/init.d/nscd ] && /etc/init.d/nscd restart +[ -x /etc/init.d/nscd ] && invoke-rc.d nscd restart echo "=================================" echo "Setting up the FAI install server" @@ -33,7 +33,7 @@ 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 -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) 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 +79,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 jessie.tmpl +fai-chboot -Iv -f verbose,sshd,createvt,menu -u nfs://faiserver/srv/fai/config buster.tmpl # Since we do not know the MAC address, our DHCP cannot provide the hostname. # Therefore we do explicitly set the hostname