From 84fc9e42fc44da8de9f7d1f44e799ef0d089faee Mon Sep 17 00:00:00 2001 From: Leif Liddy Date: Dec 21 2023 06:43:08 +0000 Subject: beautify /etc/fstab --- diff --git a/setup-swap.sh b/setup-swap.sh index f99d6c0..3e58c00 100755 --- a/setup-swap.sh +++ b/setup-swap.sh @@ -24,7 +24,12 @@ restorecon -v -r '/var/swap' mkswap /var/swap/swapfile swapon /var/swap/swapfile -grep -q /var/swap/swapfile /etc/fstab || echo '/var/swap/swapfile swap swap sw 0 0' >> /etc/fstab + +if [[ ! $(grep /var/swap/swapfile /etc/fstab) ]]; then + echo '/var/swap/swapfile swap swap sw 0 0' >> /etc/fstab + fstab_col=$(column -t /etc/fstab) + echo "$fstab_col" > /etc/fstab +fi # If we got this far, disable it for good measure (even though it should not run again) systemctl disable asahi-setup-swap-firstboot.service