feat: Print warning based on OS (#62)
This commit is contained in:
parent
f143f7c59b
commit
cc86e245cc
3 changed files with 30 additions and 4 deletions
|
@ -244,6 +244,23 @@ closeNetwork() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkOS() {
|
||||||
|
|
||||||
|
local name
|
||||||
|
local os=""
|
||||||
|
name=$(uname -a)
|
||||||
|
|
||||||
|
[[ "${name,,}" == *"darwin"* ]] && os="MacOS"
|
||||||
|
[[ "${name,,}" == *"microsoft"* ]] && os="Windows"
|
||||||
|
|
||||||
|
if [ -n "$os" ]; then
|
||||||
|
error "You are using Docker Desktop for $os which does not support macvlan, please revert to bridge networking!"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
getInfo() {
|
getInfo() {
|
||||||
|
|
||||||
if [ -z "$VM_NET_DEV" ]; then
|
if [ -z "$VM_NET_DEV" ]; then
|
||||||
|
@ -305,6 +322,8 @@ fi
|
||||||
|
|
||||||
if [[ "$DHCP" == [Yy1]* ]]; then
|
if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
|
|
||||||
|
! checkOS && exit 19
|
||||||
|
|
||||||
if [[ "$GATEWAY" == "172."* ]]; then
|
if [[ "$GATEWAY" == "172."* ]]; then
|
||||||
warn "your gateway IP starts with 172.* which is often a sign that you are not on a macvlan network (required for DHCP)!"
|
warn "your gateway IP starts with 172.* which is often a sign that you are not on a macvlan network (required for DHCP)!"
|
||||||
fi
|
fi
|
||||||
|
@ -314,6 +333,10 @@ if [[ "$DHCP" == [Yy1]* ]]; then
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
if [[ "$GATEWAY" != "172."* ]]; then
|
||||||
|
! checkOS && exit 19
|
||||||
|
fi
|
||||||
|
|
||||||
# Configuration for static IP
|
# Configuration for static IP
|
||||||
configureNAT
|
configureNAT
|
||||||
|
|
||||||
|
|
10
src/proc.sh
10
src/proc.sh
|
@ -24,9 +24,13 @@ if [[ "$KVM" != [Nn]* ]]; then
|
||||||
|
|
||||||
if [ -n "$KVM_ERR" ]; then
|
if [ -n "$KVM_ERR" ]; then
|
||||||
KVM="N"
|
KVM="N"
|
||||||
error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance."
|
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||||
error "See the FAQ on how to enable it, or continue without KVM by setting KVM=N (not recommended)."
|
warn "you are using MacOS which has no KVM support, this will cause a major loss of performance."
|
||||||
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
else
|
||||||
|
error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance."
|
||||||
|
error "See the FAQ on how to enable it, or continue without KVM by setting KVM=N (not recommended)."
|
||||||
|
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,7 +17,6 @@ echo "❯ For support visit $SUPPORT"
|
||||||
|
|
||||||
: "${BOOT:=""}" # URL of the ISO file
|
: "${BOOT:=""}" # URL of the ISO file
|
||||||
: "${DEBUG:="N"}" # Disable debugging
|
: "${DEBUG:="N"}" # Disable debugging
|
||||||
: "${CONSOLE:="N"}" # Disable console
|
|
||||||
: "${MACHINE:="virt"}" # Machine selection
|
: "${MACHINE:="virt"}" # Machine selection
|
||||||
: "${ALLOCATE:=""}" # Preallocate diskspace
|
: "${ALLOCATE:=""}" # Preallocate diskspace
|
||||||
: "${ARGUMENTS:=""}" # Extra QEMU parameters
|
: "${ARGUMENTS:=""}" # Extra QEMU parameters
|
||||||
|
|
Loading…
Reference in a new issue