Functions #1

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

22
shemum
View file

@ -45,17 +45,26 @@ esac
# Functions
# Virtual machine removal
remove function {
remove_func function {
rm -r $ROOT_PATH/$OS_NAME
}
start function {
# Virtual machine start without a console
start_func function {
qemu-system-x86_64 -boot c \
-display none \
-drive file=$IMG_PATH,format=raw \
-m $RAM -smp $CPU
}
# Virtual machine start with a console
console_func function {
qemu-system-x86_64 -boot c \
-display curses \
-drive file=$IMG_PATH,format=raw \
-m $RAM -smp $CPU
}
# Options
case $OPTION in
# Initializes the VM and starts the installer image.
@ -78,16 +87,13 @@ case $OPTION in
-m $RAM -smp $CPU
;;
"console")
qemu-system-x86_64 -boot c \
-display curses \
-drive file=$IMG_PATH,format=raw \
-m $RAM -smp $CPU
console_func
;;
"start")
start
start_func
;;
"remove")
remove
remove_func
;;
*)
echo "Usage: shemum [init] <virtual machine name> <disk size>"