slitaz-boot-scripts rev 391 5.6.7
system.sh: revert commit 378 restores swap activation
author | Richard Dunbar <mojo@slitaz.org> |
---|---|
date | Sat Feb 07 15:49:16 2015 -0500 (2015-02-07) |
parents | 8a6c5a33f76e |
children | 017e46ba678b |
files | etc/init.d/system.sh |
line diff
1.1 --- a/etc/init.d/system.sh Sun Jan 11 11:12:35 2015 +0100 1.2 +++ b/etc/init.d/system.sh Sat Feb 07 15:49:16 2015 -0500 1.3 @@ -60,20 +60,19 @@ 1.4 fi 1.5 1.6 # Activate an eventual swap file or partition 1.7 +if [ "$(blkid | grep 'TYPE="swap"')" ]; then 1.8 + for swd in $(blkid | sed '/TYPE="swap"/!d;s/:.*//'); do 1.9 + if ! grep -q "$swd " /etc/fstab; then 1.10 + echo "Swap memory detected on: $swd" 1.11 + cat >> /etc/fstab <<EOT 1.12 +$swd swap swap defaults 0 0 1.13 +EOT 1.14 + fi 1.15 + done 1.16 +fi 1.17 if grep -q swap /etc/fstab; then 1.18 echo -n "Activating swap memory..." 1.19 swapon -a && status 1.20 -else 1.21 - if [ "$(blkid | grep 'TYPE="swap"')" ]; then 1.22 - for swd in $(blkid | sed '/TYPE="swap"/!d;s/:.*//'); do 1.23 - if ! grep -q "$swd " /etc/fstab; then 1.24 - echo "Swap memory detected on: $swd" 1.25 - cat >> /etc/fstab <<EOT 1.26 -$swd swap swap defaults 0 0 1.27 -EOT 1.28 - fi 1.29 - done 1.30 - fi 1.31 fi 1.32 1.33 # Start TazPanel