Modification mkvm pour s-fog
This commit is contained in:
parent
ca6a1b9513
commit
7f4588c279
30
scripts/mkvm
30
scripts/mkvm
@ -1,7 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ovarelease="2023a"
|
ovarelease="2023a"
|
||||||
|
ovafogrelease="2023a"
|
||||||
ovafile="$HOME/Téléchargements/debian-bullseye-gsb-${ovarelease}.ova"
|
ovafile="$HOME/Téléchargements/debian-bullseye-gsb-${ovarelease}.ova"
|
||||||
|
ovafilefog="$HOME/Téléchargements/debian-buster-${ovafogrelease}.ova"
|
||||||
|
|
||||||
|
|
||||||
usage () {
|
usage () {
|
||||||
@ -12,27 +14,31 @@ usage () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create_vm () {
|
create_vm () {
|
||||||
nom=$1
|
nom="$1"
|
||||||
if [[ ! -r "${ovafile}" ]]; then
|
nomova=${ovafile}
|
||||||
echo "$0 : erreur ouverture fichier ${ovafile} ..."
|
if [[ "${nom}" == "s-fog" ]] ; then
|
||||||
|
nomova="${ovafilefog}"
|
||||||
|
fi
|
||||||
|
if [[ ! -r "${nomova}" ]]; then
|
||||||
|
echo "$0 : erreur ouverture fichier ${nomova} ..."
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
vboxmanage import "${ovafile}" --vsys 0 --vmname "${nom}"
|
vboxmanage import "${nomova}" --vsys 0 --vmname "${nom}"
|
||||||
}
|
}
|
||||||
|
|
||||||
setif () {
|
setif () {
|
||||||
|
|
||||||
VBoxManage modifyvm $1 --nic${2} intnet
|
VBoxManage modifyvm "$1" --nic"${2}" intnet
|
||||||
VBoxManage modifyvm $1 --intnet${2} $3
|
VBoxManage modifyvm "$1" --intnet"${2}" "$3"
|
||||||
VBoxManage modifyvm $1 --nictype${2} 82540EM
|
VBoxManage modifyvm "$1" --nictype"${2}" 82540EM
|
||||||
VBoxManage modifyvm $1 --cableconnected${2} on
|
VBoxManage modifyvm "$1" --cableconnected"${2}" on
|
||||||
VBoxManage modifyvm $1 --nicpromisc${2} allow-all
|
VBoxManage modifyvm "$1" --nicpromisc"${2}" allow-all
|
||||||
}
|
}
|
||||||
|
|
||||||
create_if () {
|
create_if () {
|
||||||
# enp0s3
|
# enp0s3
|
||||||
setif $1 1 $2
|
setif "$1" 1 "$2"
|
||||||
setif $1 2 $3
|
setif "$1" 2 "$3"
|
||||||
#(enp0s8)
|
#(enp0s8)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +47,7 @@ if [[ $# != 1 ]] ; then
|
|||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
vm=$1
|
vm="$1"
|
||||||
|
|
||||||
create_vm "${vm}"
|
create_vm "${vm}"
|
||||||
if [[ "${vm}" == "s-infra" ]] ; then
|
if [[ "${vm}" == "s-infra" ]] ; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user