v1.01 - Fixed reporting bug in addswap.sh
This commit is contained in:
parent
19ce92eb78
commit
9b2bf8abd2
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
## addswap.sh
|
## addswap.sh
|
||||||
## version 1.0
|
## version 1.01
|
||||||
## Quickly add and activate a SWAP file.
|
## Quickly add and activate a SWAP file.
|
||||||
|
|
||||||
## Author: Ze'ev Schurmann
|
## Author: Ze'ev Schurmann
|
||||||
|
@ -155,6 +155,7 @@ if [[ $freespace -gt $swapsize ]]; then
|
||||||
|
|
||||||
echolog "/swapfile.$ext exists...[Inactive] > Removing"
|
echolog "/swapfile.$ext exists...[Inactive] > Removing"
|
||||||
bash remswap.sh "/swapfile.$ext"
|
bash remswap.sh "/swapfile.$ext"
|
||||||
|
filecount=$(swapon --show | grep "file" | wc -l)
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -169,6 +170,7 @@ if [[ $freespace -gt $swapsize ]]; then
|
||||||
swapon /swapfile.$ext
|
swapon /swapfile.$ext
|
||||||
echo "/swapfile.$ext none swap sw 0 0" >> /etc/fstab
|
echo "/swapfile.$ext none swap sw 0 0" >> /etc/fstab
|
||||||
checking=false
|
checking=false
|
||||||
|
filecount=$(swapon --show | grep "file" | wc -l)
|
||||||
echolog "You now have $partitioncount active swap partitions and $filecount active swap files."
|
echolog "You now have $partitioncount active swap partitions and $filecount active swap files."
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue