mirror of
https://github.com/kevinveenbirkenbach/create-linux-swapfile.git
synced 2024-11-24 01:41:02 +01:00
Update create-linux-swapfile.sh
Added size parameter
This commit is contained in:
parent
2133eaa94d
commit
d68cc2c18e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user