iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update to upstream 5.3.4
[automated-distro-installer]
/
fai
/
config
/
files
/
etc
/
rc.local
/
FAISERVER
diff --git
a/fai/config/files/etc/rc.local/FAISERVER
b/fai/config/files/etc/rc.local/FAISERVER
index 764c62aa83676a57a29778356187fe21fe74427e..dffa360eb4d42bcbb0bddb1caabc8e14c735be1d 100755
(executable)
--- a/
fai/config/files/etc/rc.local/FAISERVER
+++ b/
fai/config/files/etc/rc.local/FAISERVER
@@
-11,6
+11,11
@@
set -o pipefail
# setup network
ifup eth0
# setup network
ifup eth0
+# regenerate ssh_host keys
+ls /etc/ssh/ssh_host_* > /dev/null
+if [ $? -ne 0 ]; then
+ dpkg-reconfigure -fnoninteractive openssh-server
+fi
sleep 8
[ -x /etc/init.d/nscd ] && /etc/init.d/nscd restart
sleep 8
[ -x /etc/init.d/nscd ] && /etc/init.d/nscd restart
@@
-26,16
+31,12
@@
echo "=================================" >/dev/console
if [ ! -d "$FAI_CONFIGDIR/class" ]; then
mkdir -p $FAI_CONFIGDIR
cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
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"
+ 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)
echo "APTPROXY=http://$myip:3142" >> /srv/fai/config/class/DEBIAN.var
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)
echo "APTPROXY=http://$myip:3142" >> /srv/fai/config/class/DEBIAN.var
- # determine a fast mirror for Ubuntu
- list=$(curl -s http://mirrors.ubuntu.com/mirrors.txt)
- mirror=$(netselect $list | awk '{print $2}')
- sed -i -e "s#MIRRORURL#$mirror#" /srv/fai/config/files/etc/apt/sources.list/UBUNTU
fi
# set the LOGUSER, wo we get all the logs from our install clients
fi
# set the LOGUSER, wo we get all the logs from our install clients
-ainsl /etc/fai/fai.conf "LOGUSER=fai"
+ainsl /etc/fai/fai.conf "
^
LOGUSER=fai"
# make index, then import the packages from the CD mirror
apt-get update
# make index, then import the packages from the CD mirror
apt-get update
@@
-43,7
+44,11
@@
curl -fs 'http://127.0.0.1:3142/acng-report.html?doImport=Start+Import&calcSize=
# setup the FAI server, including creating the nfsroot, use my own proxy
export APTPROXY="http://127.0.0.1:3142"
# setup the FAI server, including creating the nfsroot, use my own proxy
export APTPROXY="http://127.0.0.1:3142"
-fai-setup -fvB /var/tmp/base.tar.xz 2>&1
+if [ -f /var/tmp/base.tar.xz ]; then
+ fai-setup -fvB /var/tmp/base.tar.xz 2>&1
+else
+ fai-setup -fv 2>&1
+fi
if [ $? -eq 0 ]; then
rm /var/tmp/base.tar.xz
echo ""
if [ $? -eq 0 ]; then
rm /var/tmp/base.tar.xz
echo ""
@@
-87,4
+92,10
@@
fai-monitor > /var/log/fai/fai-monitor.log &
# move me away
mv $0 /var/tmp
# move me away
mv $0 /var/tmp
+
+# create new rc.local for next reboot
+echo '#! /bin/bash' > /etc/rc.local
+echo 'fai-monitor > /var/log/fai/fai-monitor.log &' >> /etc/rc.local
+chmod a+rx /etc/rc.local
+
exit 0
exit 0