Unverified Commit e8ed1eae authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Trap

parent ea3c9c8b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
#!/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="<HTML><BODY><H1><CENTER>$2</CENTER></H1></BODY></HTML>"
RESPONSE="HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n$HTML\r\n"