feat: Display progress via web (#584)

This commit is contained in:
Kroese
2024-01-20 19:59:44 +01:00
committed by GitHub
parent fc92b66ff4
commit 2c7cea042f
11 changed files with 257 additions and 101 deletions

View File

@@ -173,14 +173,17 @@ closeNetwork() {
if [[ "$DHCP" == [Yy1]* ]]; then
fKill "server.sh"
# Shutdown nginx
nginx -s stop 2> /dev/null
fWait "nginx"
ip link set "$VM_NET_TAP" down || true
ip link delete "$VM_NET_TAP" || true
else
fKill "dnsmasq"
local pid="/var/run/dnsmasq.pid"
[ -f "$pid" ] && pKill "$(<"$pid")"
ip link set "$VM_NET_TAP" down promisc off || true
ip link delete "$VM_NET_TAP" || true
@@ -227,8 +230,6 @@ getInfo() {
# Configure Network
# ######################################
fKill "server.sh"
if [ ! -c /dev/vhost-net ]; then
if mknod /dev/vhost-net c 10 238; then
chmod 660 /dev/vhost-net
@@ -236,6 +237,7 @@ if [ ! -c /dev/vhost-net ]; then
fi
getInfo
html "Initializing network..."
if [[ "$DEBUG" == [Yy1]* ]]; then
info "Container IP is $IP with gateway $GATEWAY on interface $VM_NET_DEV" && echo
@@ -252,11 +254,15 @@ if [[ "$DHCP" == [Yy1]* ]]; then
# Configuration for DHCP IP
configureDHCP
# Display IP on port 80 and 5000
/run/server.sh 5000 /run/ip.sh &
MSG="Please wait while discovering IP..."
html "$MSG" "2000"
else
# Shutdown nginx
nginx -s stop 2> /dev/null
fWait "nginx"
# Configuration for static IP
configureNAT