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

feat: Add option to disable networking (#447)

parent 4c10cc6a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@ case "${DISPLAY,,}" in
  web)
    DISPLAY_OPTS="-display vnc=:0,websocket=5700 -vga $VGA"
    ;;
  disabled)
    DISPLAY_OPTS="-display none -vga $VGA"
    ;;
  none)
    DISPLAY_OPTS="-display none -vga none"
    ;;
+8 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ set -Eeuo pipefail

: "${MAC:=""}"
: "${DHCP:="N"}"
: "${NETWORK:="Y"}"
: "${HOST_PORTS:=""}"

: "${VM_NET_DEV:=""}"
@@ -201,6 +202,8 @@ closeNetwork() {
  nginx -s stop 2> /dev/null
  fWait "nginx"

  [[ "$NETWORK" != [Yy1]* ]] && return 0

  exec 30<&- || true
  exec 40<&- || true

@@ -271,6 +274,11 @@ getInfo() {
#  Configure Network
# ######################################

if [[ "$NETWORK" != [Yy1]* ]]; then
  NET_OPTS=""
  return 0
fi

if [ ! -c /dev/vhost-net ]; then
  if mknod /dev/vhost-net c 10 238; then
    chmod 660 /dev/vhost-net