diff --git a/genswap.sh b/genswap.sh index 713608b..f3c44b4 100755 --- a/genswap.sh +++ b/genswap.sh @@ -72,8 +72,9 @@ function autoSwap(){ CHECKFSTAB=$(cat /etc/fstab | grep "swap" | gawk '/swap/{print $2}') - if [ ! $CHECKFSTAB ];then + if [ $CHECKFSTAB != "swap" ];then echo -e "${LRED}Swap line does not exist in /etc/fstab, please manually check this.${NC}\n" + exit 1 else echo -e "${LGREEN}Swap successfully added to /etc/fstab! Please reboot your machine...${NC}\n"