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
|
||||
}
|
||||
|
||||
# Virtual machine initialization with a console
|
||||
init_func function {
|
||||
mkdir -p "$ROOT_PATH/$OS_NAME"
|
||||
qemu-img create $IMG_PATH $DISK_SIZE
|
||||
|
@ -84,6 +85,15 @@ init_func function {
|
|||
-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
|
||||
case $OPTION in
|
||||
# Initializes the VM and starts the installer image.
|
||||
|
@ -100,11 +110,7 @@ case $OPTION in
|
|||
remove_func
|
||||
;;
|
||||
*)
|
||||
echo "Usage: shemum [init] <virtual machine name> <disk size>"
|
||||
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"
|
||||
usage_func
|
||||
esac
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue