Initial configuration for FAI (work in progress)
[grml-live.git] / etc / grml / fai / config / files / etc / rc2.d / S99fai-setup / FAISERVER
diff --git a/etc/grml/fai/config/files/etc/rc2.d/S99fai-setup/FAISERVER b/etc/grml/fai/config/files/etc/rc2.d/S99fai-setup/FAISERVER
new file mode 100755 (executable)
index 0000000..2d1568f
--- /dev/null
@@ -0,0 +1,29 @@
+#! /bin/bash
+
+# setup script that is only run once at boot time
+
+echo "Creating the nfsroot for FAI."
+
+. /etc/fai/fai.conf
+
+if [ ! -d "$FAI_CONFIGDIR/class" ]; then
+    mkdir -p $FAI_CONFIGDIR
+    cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
+fi
+
+# setup network
+dhclient eth0  # connection to the outside world (hopefully)
+ifconfig eth0:1 192.168.1.250 # (fixed address of faiserver)
+/etc/init.d/nscd restart
+/etc/init.d/apache2 restart
+/etc/init.d/apt-proxy restart
+
+fai-setup -v 2>&1 | tee /var/log/fai-setup.log
+
+# create default pxelinux boot configuration (boot from local disk)
+fai-chboot -o default
+
+echo "Log files are saved to /var/log/fai-setup.log"
+
+# remove me
+rm $0