nueva funcion showVms para mostrar vms

master
fanta 2 years ago
parent a56489ff02
commit 61f482d7b7

14
q

@ -4,6 +4,7 @@ vmsDir="/home/fanta/vms"
function main(){
downloadSysList
downloadSysIsos
showVms
}
function downloadSysList(){
@ -27,9 +28,9 @@ function downloadSysIsos(){
wget -q $url -O $vmsDir/${data[0]}-${data[1]}-${data[2]}/$isoName
echo " Create img [$sizeDisc] $vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.qcow2"
qemu-img create -q -f qcow2 "$vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.qcow2" $sizeDisc
echo " Create script $vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.sh"
echo "#!/bin/bash" > "$vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.sh"
echo "qemu-system-${data[2]} $extra -m $sizeRam -cdrom $vmsDir/${data[0]}-${data[1]}-${data[2]}/$isoName -hda $vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.qcow2" >> "$vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.sh"
echo " Create install script"
echo "#!/bin/bash" > "$vmsDir/${data[0]}-${data[1]}-${data[2]}/install.sh"
echo "qemu-system-${data[2]} $extra -m $sizeRam -cdrom $vmsDir/${data[0]}-${data[1]}-${data[2]}/$isoName -hda $vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.qcow2" >> "$vmsDir/${data[0]}-${data[1]}-${data[2]}/install.sh"
echo " Create start script"
echo "#!/bin/bash" > "$vmsDir/${data[0]}-${data[1]}-${data[2]}/start.sh"
echo "qemu-system-${data[2]} $extra -m $sizeRam -hda $vmsDir/${data[0]}-${data[1]}-${data[2]}/${data[0]}-${data[1]}-${data[2]}.qcow2" > "$vmsDir/${data[0]}-${data[1]}-${data[2]}/start.sh"
@ -37,5 +38,12 @@ function downloadSysIsos(){
done < $vmsDir/.systems.lst
}
function showVms() {
echo -en "\nVMs List:\n\n"
cd $vmsDir
ls -1
echo -en "\n"
}
main

Loading…
Cancel
Save