diff --git a/newvm.sh b/newvm.sh index 4e63e7a..7150d7e 100755 --- a/newvm.sh +++ b/newvm.sh @@ -12,6 +12,7 @@ network=network=kube dnsdomain=host.pyrocufflink.black console=true default_groups=true +graphics=false usage() { printf 'usage: %s [options] name\n' "${0##*/}" @@ -76,6 +77,9 @@ while [ $# -gt 0 ]; do --domain=*) dnsdomain=${1#=*} ;; + --with-graphics) + graphics=true + ;; --cfg-branch) shift cfg_branch=$1 @@ -105,6 +109,7 @@ while [ $# -gt 0 ]; do name="$1" else usage >&2 + printf 'unknown option: %s\n' "${1}" >&2 exit 2 fi esac @@ -183,6 +188,10 @@ if [ -n "${cfg_branch}" ]; then set -- "$@" --qemu-commandline="-fw_cfg opt/dch/cfg-branch,string=${cfg_branch}" fi +if ! $graphics; then + set -- "$@" --graphics=none +fi + if $console; then set -- "$@" --autoconsole text else