From 6b6c066d7a721f256a87f940c76d819f9fdf01d9 Mon Sep 17 00:00:00 2001 From: mollusk Date: Mon, 11 Jun 2018 03:54:50 -0700 Subject: [PATCH] genswap.sh: check for gawk before main Former-commit-id: dfc001cb8a93ef514d938785f6216ead503833bd --- genswap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/genswap.sh b/genswap.sh index ff30b9c..b8a951f 100755 --- a/genswap.sh +++ b/genswap.sh @@ -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"