Added a functionality to pass arguments to install script

This commit is contained in:
Tristan Ancelet 2023-11-10 16:04:47 -06:00
parent 8f3d8912f3
commit c0bc51e9a7

View File

@ -4,8 +4,19 @@
# BEGIN: Variables # BEGIN: Variables
HOSTNAME="ExampleHostname" HOSTNAME="ExampleHostname"
BOOT_METHOD="BIOS" BOOT_METHOD="${1:?"Boot method was not provided. (BIOS, EFI)"}"
DISK='/dev/sda' BOOT_METHOD="${BOOT_METHOD^^}"
[[ ! "$BOOT_METHOD" =~ ^(EFI|BIOS)$ ]] && {
echo "Your boot method $BOOT_METHOD, is not acceptible. Please provide a vaild one"
exit
}
DISK="${2:?"Disk was not provided"}"
[[ ! -d $DISK ]] && {
echo "Your disk ($DISK) does not exist. Please provide a valid one"
exit
}
EFI_PARTITION=${DISK}1 EFI_PARTITION=${DISK}1
SWAP_PARTITION=${DISK}2 SWAP_PARTITION=${DISK}2
ROOT_PARTITION=${DISK}3 ROOT_PARTITION=${DISK}3