genswap.sh: check for gawk before main

Former-commit-id: dfc001cb8a93ef514d938785f6216ead503833bd
This commit is contained in:
mollusk 2018-06-11 03:54:50 -07:00
parent b5f4253782
commit 6b6c066d7a

View File

@ -6,7 +6,10 @@ TOTALRAM=$(free -m | gawk '/Mem:/{print $2}')
VERSION="0.1.0"
BUILDDATE="2018-06-05"
if [ ! -f /usr/bin/gawk ];then
echo -e "\nPlease install 'gawk' with your package manager\n"
exit 0
fi
function autoSwap(){
echo -e "\nTotal Physical RAM is: ${TOTALRAM} MB\n"
echo -e "\nCreating a ${TOTALRAM} MB file in:${SWAPPATH}..\n"