diff --git a/run/server.sh b/run/server.sh index 6a7cbef..6eb2f63 100644 --- a/run/server.sh +++ b/run/server.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eu +trap exit SIGINT SIGTERM # Close any previous instances script_name=${BASH_SOURCE[0]} @@ -11,8 +12,6 @@ for pid in $(pidof -x $script_name); do fi done -trap exit SIGINT SIGTERM - # Serve the page HTML="

$2

" RESPONSE="HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n$HTML\r\n"