From 64c55a91006d859544c41c472d07c9f06effef05 Mon Sep 17 00:00:00 2001 From: mollusk Date: Wed, 19 Sep 2018 03:01:32 -0700 Subject: [PATCH] genswap.sh: check fstab using != 'swap', add exit status Former-commit-id: dd75bbdf3abf9482db07c7839b86a6674e488a20 --- genswap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"