From d68cc2c18ea10f6c494bbd6a425f51d99f30a601 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 18 Aug 2022 18:00:44 +0200 Subject: [PATCH] Update create-linux-swapfile.sh Added size parameter --- create-linux-swapfile.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create-linux-swapfile.sh b/create-linux-swapfile.sh index c850ee6..27cbc6c 100644 --- a/create-linux-swapfile.sh +++ b/create-linux-swapfile.sh @@ -6,9 +6,9 @@ if grep -q "$FSTAB_SWAP_ENTRY" "$FSTAB_FILE"; then echo "Skipping creation of swap partion because entry allready exists in \"$FSTAB_FILE\"!" else echo "Creating swap partition..." && - sudo fallocate -l 16G "$SWAP_FILE" && + sudo fallocate -l "$1" "$SWAP_FILE" && sudo chmod 600 "$SWAP_FILE" && sudo mkswap "$SWAP_FILE" && sudo swapon "$SWAP_FILE" && - sudo sh -c "echo \"$FSTAB_SWAP_ENTRY\">>\"$FSTAB_FILE\"" + sudo sh -c "echo \"$FSTAB_SWAP_ENTRY\">>\"$FSTAB_FILE\"" || exit 1 fi