Functions #1
1 changed files with 11 additions and 5 deletions
16
shemum
16
shemum
|
@ -65,6 +65,7 @@ console_func function {
|
||||||
-m $RAM -smp $CPU
|
-m $RAM -smp $CPU
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Virtual machine initialization with a console
|
||||||
init_func function {
|
init_func function {
|
||||||
mkdir -p "$ROOT_PATH/$OS_NAME"
|
mkdir -p "$ROOT_PATH/$OS_NAME"
|
||||||
qemu-img create $IMG_PATH $DISK_SIZE
|
qemu-img create $IMG_PATH $DISK_SIZE
|
||||||
|
@ -84,6 +85,15 @@ init_func function {
|
||||||
-m $RAM -smp $CPU
|
-m $RAM -smp $CPU
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Display usage
|
||||||
|
usage_func function {
|
||||||
|
printf "Usage: shemum [init] <virtual machine name> <disk size>"
|
||||||
|
printf " init initialize a virtual machine"
|
||||||
|
printf " start start a QEMU virtual machine without console output"
|
||||||
|
printf " console start a QEMU virtual machine with console output"
|
||||||
|
printf " remove remove virtual machine directory and all it's contents"
|
||||||
|
}
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
# Initializes the VM and starts the installer image.
|
# Initializes the VM and starts the installer image.
|
||||||
|
@ -100,11 +110,7 @@ case $OPTION in
|
||||||
remove_func
|
remove_func
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: shemum [init] <virtual machine name> <disk size>"
|
usage_func
|
||||||
echo " init initialize a virtual machine"
|
|
||||||
echo " start start a QEMU virtual machine without console output"
|
|
||||||
echo " console start a QEMU virtual machine with console output"
|
|
||||||
echo " remove remove virtual machine directory and all it's contents"
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue