--- /dev/null
+#!/bin/bash
+
+# copyright 2013 Holger Levsen <holger@layer-acht.org>
+# GPL2 licenced
+
+set -x
+export
+
+if [ "$4" = "" ] || ( [ "$4" != "install" ] && [ "$4" != "sysinfo" ] && [ "$4" != "localboot" ] ) ; then
+ echo "$0 must be called with exactly four arguments: hostname mac networkdevice action"
+ echo "eg: $0 gw1301 01-00-25-90-2c-03-8a eth1 install"
+ echo "action must be either 'install', 'sysinfo' or 'localboot'"
+ exit 1
+fi
+
+TARGET_HOST=$1
+TARGET_MAC=$2
+TARGET_DEV=$3
+TARGET_ACTION=$4
+
+TMPFILE=$(mktemp)
+cat > $TMPFILE <<-EOF
+# Generated automatically by jenkins - don't edit manually, it will be overwritten
+TIMEOUT 100
+DEFAULT $TARGET_ACTION
+
+LABEL localboot
+MENU LABEL Local boot from HDD
+MENU DEFAULT
+LOCALBOOT 0
+
+LABEL sysinfo
+MENU LABEL sysinfo
+KERNEL fai/vmlinuz-install
+APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=sysinfo FAI_FLAGS=verbose,sshd,createvt
+
+LABEL install
+MENU LABEL install
+KERNEL fai/vmlinuz-install
+APPEND initrd=fai/initrd.img root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live live-netdev=$TARGET_DEV FAI_ACTION=install FAI_FLAGS=verbose,sshd,createvt hostname=$TARGET_HOST
+EOF
+
+cat $TMPFILE
+echo
+
+echo "Copying PXE configuration for $TARGET_HOST to riserver..."
+scp $TMPFILE riserver:/srv/tftp/pxelinux.cfg/$TARGET_MAC
+rm $TMPFILE
+
+echo "Enjoy."