From 9b2bf8abd293ca979ec063af5fffd7e9e6e34681 Mon Sep 17 00:00:00 2001 From: Ze'ev Schurmann Date: Sat, 16 Nov 2024 21:14:50 +0200 Subject: [PATCH] v1.01 - Fixed reporting bug in addswap.sh --- swap-management/addswap.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swap-management/addswap.sh b/swap-management/addswap.sh index 72417cd..e89bca1 100644 --- a/swap-management/addswap.sh +++ b/swap-management/addswap.sh @@ -1,7 +1,7 @@ #!/bin/bash ## addswap.sh -## version 1.0 +## version 1.01 ## Quickly add and activate a SWAP file. ## Author: Ze'ev Schurmann @@ -155,6 +155,7 @@ if [[ $freespace -gt $swapsize ]]; then echolog "/swapfile.$ext exists...[Inactive] > Removing" bash remswap.sh "/swapfile.$ext" + filecount=$(swapon --show | grep "file" | wc -l) fi @@ -169,6 +170,7 @@ if [[ $freespace -gt $swapsize ]]; then swapon /swapfile.$ext echo "/swapfile.$ext none swap sw 0 0" >> /etc/fstab checking=false + filecount=$(swapon --show | grep "file" | wc -l) echolog "You now have $partitioncount active swap partitions and $filecount active swap files." exit 0