Check that swap is mounted using /proc/swaps

This commit is contained in:
Michael Kroes 2016-03-22 16:40:56 +01:00
parent 85e6118ae3
commit b7bc9e11f3
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ source setup/functions.sh # load our functions
# than 5GB of disk space available # than 5GB of disk space available
# The following checks are performed: # The following checks are performed:
# - Check if swap is currently mountend by looking at /proc/mounts # - Check if swap is currently mountend by looking at /proc/swaps
# - Check if the user intents to activate swap on next boot by checking fstab entries. # - Check if the user intents to activate swap on next boot by checking fstab entries.
# - Check if a swapfile already exists # - Check if a swapfile already exists
# - Check if the root file system is not btrfs, might be an incompatible version with # - Check if the root file system is not btrfs, might be an incompatible version with
@ -26,7 +26,7 @@ source setup/functions.sh # load our functions
# See https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 # See https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
# for reference # for reference
SWAP_MOUNTED=$(grep "swap" /proc/mounts) SWAP_MOUNTED=$(cat /proc/swaps | tail -n+2)
SWAP_IN_FSTAB=$(grep "swap" /etc/fstab) SWAP_IN_FSTAB=$(grep "swap" /etc/fstab)
ROOT_IS_BTRFS=$(grep "\/ .*btrfs" /proc/mounts) ROOT_IS_BTRFS=$(grep "\/ .*btrfs" /proc/mounts)
TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}') TOTAL_PHYSICAL_MEM=$(head -n 1 /proc/meminfo | awk '{print $2}')