diff --git a/bin/qemush b/bin/qemush index fc83da7..4233eb3 100755 --- a/bin/qemush +++ b/bin/qemush @@ -53,12 +53,20 @@ error_usage() { # Function to start a virtual machine public_start() { + if [ "$1" = -f ] || [ "$1" = --foreground ]; then + daemonize= + else + daemonize=-daemonize + fi + + while echo "$1" | grep -q '^-'; do shift; done; + export QEMUSH_NAME="$1" set -- "$@" \ -name "$QEMUSH_NAME" \ -monitor "unix:$(pathof socket),server,nowait" \ - -daemonize + $daemonize if ! "$@"; then perror "error launching virtual machine \"${QEMUSH_NAME}\""