The while loop is never closed of properly. It's missing the done. Try adding it right above the line echo "</HTML>"
And the first if statement looks a bit weird, try changing it to:
Code:
if [ -z "$ENTRY" ]
then
break
fi
The output gets sent to stdout so if you want that in a file just do something like:
cat testtelefon | createhtml > newfile.html