From 1db92cb3f0e1dc161725d8869ca4c2e254b635d9 Mon Sep 17 00:00:00 2001 From: primardj Date: Wed, 31 Jan 2024 20:15:28 +0000 Subject: [PATCH] improvment of README, add in usage the parametter -l,--list to list all availables vm, check if the main location for the vm exists, in case it did not exists quit with exit code 0 --- README.md | 27 ++++++++++++++++++++++++++- vm-start.sh | 9 +++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fa4d41b..d012756 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,28 @@ # vm-start -script which permit me to launch all my vm thanks to qemu \ No newline at end of file +## Description: +script which permit to launch easily some virtual machines via qemu + +## Dependencies: + +- qemu full installation + +## Usage: + +### to get some help; + +vm-start --help + +### to list all vm already configured + +vm-start --list + +### to create a new vm + +vm-strart create create_disk= + +you can of course add options like uefi to tun in uefi mode, or nproc= to select a number of processors. + +If you go to the conf folder created the first time you launch the script, you will find all configured variables for each of your vm. + + diff --git a/vm-start.sh b/vm-start.sh index 9d25cb3..b8df630 100755 --- a/vm-start.sh +++ b/vm-start.sh @@ -14,6 +14,7 @@ NAME is the name of the virtual machine to use. PARAMETTER available -h, --help Print this help and exit -v, --version Print the version of this program and quit + -l, --list Print the list of all availables machines and quit COMMAND available init Create the conf file in conf/NAME_var.sh @@ -37,7 +38,15 @@ OPTION available -display gtk -vga qxl create_disk= Def a create disk to boot on. Is necessary for using create, or need the variable INSTALLATION_DISK_LOCATION to be set. " + MAIN_LOCATION="$HOME/virtual_machine" +# if MAIN_LOCATION doesn't exists, create the folder. +if [ -f "$MAIN_LOCATION" ] +then + mkdir "$MAIN_LOCATION" || exit 0 #Exit in case the folder can't be created. + echo "$MAIN_LOCATION created to contain all virtual machines." +fi + OPTION="-display gtk \ -usbdevice tablet"