feat: Add option to disable networking
This commit is contained in:
parent
693966a037
commit
e80235cac2
1 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue