slitaz-boot-scripts rev 378
system.sh: dont search for swap on each boot
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Jul 11 15:42:01 2014 +0200 (2014-07-11) |
parents | 95da8328cbb5 |
children | 3c9cfc3876d4 |
files | etc/init.d/system.sh |
line diff
1.1 --- a/etc/init.d/system.sh Fri Jul 11 11:49:35 2014 +0200 1.2 +++ b/etc/init.d/system.sh Fri Jul 11 15:42:01 2014 +0200 1.3 @@ -60,19 +60,20 @@ 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