Add support for timeout in check.sh script