This commit is contained in:
Zeev Diukman 2026-01-18 07:26:51 +02:00
parent 762aff0c9d
commit 20a9999ccd

16
z.sh
View file

@ -31,13 +31,17 @@ umount -R /mnt
mount -o subvol=/@ /dev/vda1 /mnt mount -o subvol=/@ /dev/vda1 /mnt
# ask user to input packages to install # ask user to input packages to install
read -r -p "Enter packages to install (space-separated): " packages_input read -r -p "Enter packages to install (space-separated): " packages_input
# convert input string to array
packages=($packages_input) packages=($packages_input)
# ask user for package installation confirmation if [[ ${#packages[@]} -eq 0 ]]; then
echo "The following packages will be installed: ${packages[@]}" $packages=("base" "linux" "linux-firmware" "vim" "git" "networkmanager" "btrfs-progs" "efibootmgr" "grub" "os-prober" "base-devel" "sudo")
# ask user for confirmation before proceeding echo "No packages specified. Defaulting to: ${packages[@]}"
read -r -p "Continue with installation? (y,N): " response else
if [[ "$response" != "y" && "$response" != "Y" ]]; then echo "The following packages will be installed: ${packages[@]}"
echo "Installation aborted." fi
read -r -p "Continue with installation? (Yes/no): " response
if [[ "$response" == "n" || "$response" == "N" ]]; then
echo "Aborting."
exit 1 exit 1
fi fi
pacstrap -K /mnt ${packages[@]} pacstrap -K /mnt ${packages[@]}