Functions #1

Merged
BonzaiBrains merged 5 commits from functions into master 2024-10-31 12:02:41 +00:00
Showing only changes of commit 1aaaf60b2d - Show all commits

16
shemum
View file

@ -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