From a43df7e768e4d4b65e4f8a8a70d99123be344eae Mon Sep 17 00:00:00 2001 From: seajee Date: Mon, 2 Sep 2024 05:27:30 +0200 Subject: [PATCH] Make swapfile optional --- install.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 3fb5174..ae9544d 100755 --- a/install.sh +++ b/install.sh @@ -96,9 +96,14 @@ mount "${disk}2" /mnt mount --mkdir "${disk}1" /mnt/boot # Swap file -echo "[INFO] Creating the swap file" -mkswap -U clear --size 4G --file /mnt/swapfile &>/dev/null -swapon /mnt/swapfile +echo "[INFO] Swapfile configuration" +read -p "Enable swap? [Y/n] " input + +if [[ "$input" != [Nn]* ]]; then + echo "[INFO] Creating the swap file" + mkswap -U clear --size 4G --file /mnt/swapfile &>/dev/null + swapon /mnt/swapfile +fi # TODO: Select the mirrors for faster download speeds