From 81a75cb4fa75b555f82ba0042c66aba7a436e8b8 Mon Sep 17 00:00:00 2001 From: mollusk Date: Wed, 19 Dec 2018 01:26:05 -0700 Subject: [PATCH] genswap.sh: fix fstab detection Former-commit-id: f298b626512a9cca1280dfa66b857dd1c2e54bdf Former-commit-id: 3f9ed7874aba8d6daa0ba1e2ea99c33ffdb3db3b --- genswap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/genswap.sh b/genswap.sh index ebe8d35..b67c976 100755 --- a/genswap.sh +++ b/genswap.sh @@ -79,9 +79,9 @@ function autoSwap(){ echo -e "${LCYAN}Adding ${SWAPPATH}${SWAPNAME} to /etc/fstab ..\n${NC}" echo "${SWAPPATH}${SWAPNAME} none swap sw 0 0" | sudo tee -a /etc/fstab - CHECKFSTAB=$(cat /etc/fstab | grep "swap" | gawk '/swap/{print $2}') + CHECKFSTAB=$(cat /etc/fstab | grep "swap" | gawk '/swap/{print $1}') - if [ "${CHECKFSTAB}" != "swap" ];then + if [ "${CHECKFSTAB}" != "/swapfile" ];then echo -e "${LRED}Swap line does not exist in /etc/fstab, please manually check this.${NC}\n" else