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

This commit is contained in:
primardj 2024-01-31 20:15:28 +00:00
parent cf1df20401
commit 1db92cb3f0
2 changed files with 35 additions and 1 deletions

View file

@ -1,3 +1,28 @@
# vm-start
script which permit me to launch all my vm thanks to qemu
## Description:
script which permit to launch easily some virtual machines via qemu
## Dependencies:
- <u>qemu</u> 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 <nom_de_la_vm> create create_disk=<location_of_iso_file>
you can of course add options like uefi to tun in uefi mode, or nproc=<nb_proc> 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.

View file

@ -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 <TODO>
COMMAND available
init Create the conf file in conf/NAME_var.sh
@ -37,7 +38,15 @@ OPTION available
-display gtk -vga qxl
create_disk=<loc_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"