<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p dir="ltr"><br>
I was not having the exit trap and the sleep+kill, I don't really get why it is necessary to have these. Looks a bit inefficient to me having a sleep and to kill your own process. But I am not really a bash expert.</p>
<p dir="ltr"><br>
><br>
> which of course does not make sense... can you try if this works? I'm guessing your script probably looks pretty much like this already...<br>
><br>
> #!/bin/bash<br>
> timeout=10<br>
> trap "exit 0" QUIT<br>
> {<br>
> sleep $timeout<br>
> kill -3 $$ 2>/dev/null<br>
> } &<br>
> read -r input<br>
> exit_code=$?<br>
> if [ ${exit_code} -eq 0 ]; then<br>
> echo -n -e "HTTP/1.1 200 OK\r\n"<br>
> echo -n -e "Content-Length: 0\r\n"<br>
> echo -n -e "\r\n"<br>
> fi<br>
> exit 0<br>
</p>
</body>
</html>