#!/bin/sh -e
#
# Check the PXE setup.

if test -r /etc/debian-edu/config ; then
    . /etc/debian-edu/config
fi

# Only Main-Server should have the PXE boot setup
if echo "$PROFILE" | grep -q Main-Server ; then
    :
else
    exit 0
fi

file=/var/lib/tftpboot/pxelinux.0
if [ -f $file ] ; then
	echo "success: $0: PXE file $file is present"
else
	echo "error: $0: Unable to find PXE file $file"
fi

if egrep -q '^tftp.*/var/lib/tftpboot' /etc/inetd.conf ; then
	echo "success: $0: tftp entry in /etc/inetd.conf is using /var/lib/tftpboot"
else
	echo "error: $0: tftp entry in /etc/inetd.conf do not use /var/lib/tftpboot"
fi
