Bash-timers

From I Will Fear No Evil
Revision as of 11:02, 12 January 2022 by Chubbard (talk | contribs) (Created page with "Simplest way to get a timer on something that does not have a builtin timeout system [https://serverfault.com/questions/361464/is-it-possible-to-set-a-timeout-on-openssls-s-c...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simplest way to get a timer on something that does not have a builtin timeout system

Origional source

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