Bash-timers
Jump to navigation
Jump to search
Simplest way to get a timer on something that does not have a builtin timeout system
timeout 5 bash -c "echo '' | ${OPENSSL} s_client -connect ${1}:${2} -servername ${CLN} ${TLSFLAG} 2> ${ERROR_TMP} 1> ${CERT_TMP}" || echo "ssl connection timeout" > ${ERROR_TMP} Exit code is non-zero on timeout Using a || will allow for the timeout itself to leave a message