mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
Webserver updates
This commit is contained in:
commit
5a372bc98e
@ -2,7 +2,7 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Display wait message on port 5000
|
# Display wait message on port 5000
|
||||||
/run/server.sh 5000 > /dev/null &
|
/run/server.sh 5000 "Please wait while Virtual DSM is installing..." > /dev/null &
|
||||||
|
|
||||||
DL="https://global.synologydownload.com/download/DSM"
|
DL="https://global.synologydownload.com/download/DSM"
|
||||||
|
|
||||||
|
@ -179,6 +179,9 @@ else
|
|||||||
# Configuration for DHCP IP
|
# Configuration for DHCP IP
|
||||||
configureDHCP
|
configureDHCP
|
||||||
|
|
||||||
|
# Display the received IP on port 5000
|
||||||
|
/run/server.sh 5000 "The location of DSM is http://${DHCP_IP}:5000" > /dev/null &
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet0,mac=${VM_NET_MAC},id=net0"
|
NET_OPTS="${NET_OPTS} -device virtio-net-pci,romfile=,netdev=hostnet0,mac=${VM_NET_MAC},id=net0"
|
||||||
|
@ -1,10 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eu
|
set -eu
|
||||||
|
trap exit SIGINT SIGTERM
|
||||||
|
|
||||||
HTML="<HTML><BODY><H1><CENTER>Please wait while Virtual DSM is installing...</CENTER></H1></BODY></HTML>"
|
# Close any previous instances
|
||||||
RESPONSE="HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n$HTML\r\n"
|
script_name=${BASH_SOURCE[0]}
|
||||||
|
|
||||||
while { echo -en "$RESPONSE"; } | nc -lN "${1:-8080}"; do
|
for pid in $(pidof -x $script_name); do
|
||||||
echo "================================================"
|
if [ $pid != $$ ]; then
|
||||||
|
kill -15 $pid 2> /dev/null
|
||||||
|
wait $pid 2> /dev/null
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Serve the page
|
||||||
|
HTML="<HTML><HEAD><STYLE>body { color: white; background-color: #00BFFF; } </STYLE></HEAD><BODY><BR><BR><H1><CENTER>$2</CENTER></H1></BODY></HTML>"
|
||||||
|
LENGTH="${#HTML}"
|
||||||
|
|
||||||
|
RESPONSE="HTTP/1.1 200 OK\nContent-Length: ${LENGTH}\nConnection: close\n\n$HTML\n\n"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
echo -en "$RESPONSE" | nc -N -lp "${1:-8080}";
|
||||||
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user