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