function cleanup() {
 rm -v $TEMPFILE
}

# catch HUP, INT, QUIT, and TERM
trap cleanup 1 2 3 15