This commit is contained in:
Kroese 2023-04-20 16:02:21 +02:00 committed by GitHub
parent c590c6d1b3
commit acc53262b8

View File

@ -9,7 +9,7 @@ for pid in $(pidof -x $script_name); do
if [ $pid != $$ ]; then if [ $pid != $$ ]; then
kill -15 $pid 2> /dev/null kill -15 $pid 2> /dev/null
wait $pid 2> /dev/null wait $pid 2> /dev/null
fi fi
done done
# Serve the page # Serve the page
@ -18,6 +18,6 @@ LENGTH=$(echo "$HTML" | wc -c);
RESPONSE="HTTP/1.1 200 OK\nContent-Length: ${LENGTH}\nConnection: close\n\n$HTML\n\n" RESPONSE="HTTP/1.1 200 OK\nContent-Length: ${LENGTH}\nConnection: close\n\n$HTML\n\n"
while true; do while true; do
echo -en "$RESPONSE" | nc -N -lp "${1:-8080}"; echo -en "$RESPONSE" | nc -N -lp "${1:-8080}";
done done