Skip to content

Instantly share code, notes, and snippets.

@gwynp
Created June 19, 2012 18:01
Show Gist options
  • Save gwynp/2955594 to your computer and use it in GitHub Desktop.
Save gwynp/2955594 to your computer and use it in GitHub Desktop.
swap check
SWAPPING=`free -mo | grep Swap | { read a b c d; echo $c; }`
if [[ $SWAPPING -gt 0 ]]
then
echo "swap space is showing being used by free"
return 1
else
echo "free is showing no swap space being used"
return 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment