#set -x
export
+echo
if [ "$4" = "" ] || ( [ "$4" != "install" ] && [ "$4" != "sysinfo" ] && [ "$4" != "localboot" ] ) ; then
echo "$0 must be called with exactly four arguments: hostname mac networkdevice action"
TARGET_DEV=$3
TARGET_ACTION=$4
+echo "Re-configuring PXE on riserver:"
+echo
+echo " NIC: $TARGET_MAC (hostname: $TARGET_HOST) on $TARGET_DEV"
+echo
+echo " next PXE boot will result in: $TARGET_ACTION"
+echo
+echo
+echo
+
TMPFILE=$(mktemp)
cat > $TMPFILE <<-EOF
# Generated automatically by jenkins - don't edit manually, it will be overwritten
cat $TMPFILE
echo
-
+echo
echo "Copying PXE configuration for $TARGET_HOST to riserver..."
scp $TMPFILE riserver:/srv/tftp/pxelinux.cfg/$TARGET_MAC
-ssh riserver chmod 755 riserver:/srv/tftp/pxelinux.cfg/$TARGET_MAC
+ssh riserver chmod 755 /srv/tftp/pxelinux.cfg/$TARGET_MAC
rm $TMPFILE
-
+echo
echo "Enjoy."