genswap.sh: fix fstab detection
Former-commit-id: f298b626512a9cca1280dfa66b857dd1c2e54bdf Former-commit-id: 3f9ed7874aba8d6daa0ba1e2ea99c33ffdb3db3b
This commit is contained in:
parent
752adcd0dc
commit
81a75cb4fa
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user