works after some work

besides the typo in line 411.

we had to copy the “create tempdir” part to the “connect only check” as otherwise tftp always fails for “permission denied” – resulting in this update:

function check_connect () {
HOST=”$1″
# tmp-dir creation is necessary also for connect-only-check
# as the tftp get fails otherwise with “permission denied”
# 20130509 [email protected]
TMPDIR=/tmp/check_tftp
mkdir -p “$TMPDIR”
cd “$TMPDIR” || {
echo “Cannot create temporary directory in /tmp”
exit $STATE_UNKNOWN
}
RESULT=”$(echo get NaGiOs_ChEcK_FiLe | tftp $HOST 2>&1 | head -n 1)”
rm -f NaGiOs_ChEcK_FiLe
# call fixed – was: check_prinzipal_errors “$RESULT”
check_principal_errors “$RESULT”
case “$RESULT” in
*”Error code 1: File not found”)
echo “TFTP OK – answer from server”
exit $STATE_OK
;;
*)
echo “$RESULT”
exit $STATE_CRITICAL
;;
esac
}