ajout option -s pour mkvm

This commit is contained in:
phil 2024-01-14 23:19:06 +01:00
parent 5dcaeb0629
commit beca7dbdcc

View File

@ -1,19 +1,21 @@
#!/bin/bash
mkvmrelease="v1.3.1"
mkvmrelease="v1.3.2"
ovarelease="2023c"
ovafogrelease="2024a"
#ovafile="$HOME/Téléchargements/debian-bullseye-gsb-${ovarelease}.ova"
ovafile="$HOME/Téléchargements/debian-bookworm-gsb-${ovarelease}.ova"
ovafilefog="$HOME/Téléchargements/debian-bullseye-gsb-${ovafogrelease}.ova"
startmode=0
deletemode=0
usage () {
echo "$0 - version ${mkvmrelease} - Ova version ${ovarelease}"
echo "$0 : creation VM et parametrage interfaces"
echo "usage : $0 [-r] <s-adm|s-infra|r-int|r-ext|s-proxy|s-mon|s-appli|s-backup|s-itil|s-ncx|s-fog>"
echo " option -r : efface vm existante avant creation nouvelle"
echo "usage : $0 [-r] [-s] <s-adm|s-infra|r-int|r-ext|s-proxy|s-mon|s-appli|s-backup|s-itil|s-ncx|s-fog>"
echo " option -r : efface VM existante avant creation nouvelle"
echo " option -s : start VM apres creation"
exit 1
}
@ -59,6 +61,10 @@ fi
if [[ $1 == "--help" ]] || [[ $1 == "-h" ]] || [[ $1 == "-V" ]] ; then
usage
fi
if [[ $1 == "-s" ]] ; then
startmode=1
shift
fi
if [[ $1 == "-r" ]] ; then
deletemode=1
shift
@ -123,3 +129,6 @@ else
echo "$0 : vm ${vm} non prevue "
exit 2
fi
if [[ $startmode == 1 ]] ; then
vboxmanage startvm "${vm}"--type headless
fi