diff --git a/Dockerfile b/Dockerfile
index 0aaec57..58b98d7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -20,15 +20,15 @@ RUN apt-get update && apt-get -y upgrade && \
fdisk \
unzip \
procps \
+ dnsmasq \
xz-utils \
iptables \
iproute2 \
- dnsmasq \
net-tools \
btrfs-progs \
+ netcat-openbsd \
ca-certificates \
qemu-system-x86 \
- netcat-traditional \
&& apt-get clean
COPY run/*.sh /run/
diff --git a/run/network.sh b/run/network.sh
index 473d48c..4781009 100644
--- a/run/network.sh
+++ b/run/network.sh
@@ -238,7 +238,7 @@ if [[ "${DHCP}" == [Yy1]* ]]; then
echo "setTimeout(function(){ window.location.assign('http://\${IP}:\${PORT}'); }, 3000);\""
echo "HTML=\"
VirtualDSM
\$BODY
\""
- echo "LENGTH=\"\${#HTML}\"; RESPONSE=\"HTTP/1.1 200 OK\\nContent-Length: \${LENGTH}\\nConnection: close\\n\\n\$HTML\\n\\n\""
+ echo "LENGTH=\"\${#HTML}\"; RESPONSE=\"HTTP/1.1 200 OK\\nContent-Length: \${LENGTH}\\nConnection: close\\n\\n\$HTML\""
echo "echo -e \"\$RESPONSE\""
} > "$SH_SCRIPT"
diff --git a/run/server.sh b/run/server.sh
index b6a8a4e..26c7722 100644
--- a/run/server.sh
+++ b/run/server.sh
@@ -1,18 +1,19 @@
#!/usr/bin/env bash
set -eu
+TMP_FILE=""
+
stop() {
trap - SIGINT EXIT
- { pkill -f nc || true; } 2>/dev/null
+ { pkill -f socat || true; } 2>/dev/null
+ [ -f "$TMP_FILE" ] && rm -f "$TMP_FILE"
}
trap 'stop' EXIT SIGINT SIGTERM SIGHUP
if [[ "$2" == "/"* ]]; then
- while true ; do
- nc -lp "${1:-5000}" -e "$2" & wait $!
- done
+ socat TCP4-LISTEN:"${1:-5000}",reuseaddr,fork,crlf SYSTEM:"$2" 2> /dev/null & wait $!
else
@@ -20,10 +21,9 @@ else
Arial,sans-serif; } a, a:hover, a:active, a:visited { color: white; }
$2