v1.01 - Fixed reporting bug in addswap.sh

This commit is contained in:
ZAKS Web 2024-11-16 21:14:50 +02:00
parent 19ce92eb78
commit 9b2bf8abd2
1 changed files with 3 additions and 1 deletions

View File

@ -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