X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Fboot%2F3020-swapon;h=3df90de0e869b147ca303e6e3e438d2afd2bf4a0;hb=2648cbc4fbb19cc4b20bca4b4f3d38d515f130a1;hp=e7aed6c0551ee861335509e4f3d0fd70abf4bfc5;hpb=18d2f858d485f89f667d012efc76386f82ffda59;p=live-boot-grml.git diff --git a/scripts/boot/3020-swapon b/scripts/boot/3020-swapon index e7aed6c..3df90de 100755 --- a/scripts/boot/3020-swapon +++ b/scripts/boot/3020-swapon @@ -29,15 +29,6 @@ Swap () LIVE_SWAP_DEVICES="${LIVE_SWAP_DEVICES:-/dev/sd* /dev/vd*}" - if [ -e /root/etc/fstab.d ] - then - # wheezy - _FSTAB="/root/etc/fstab.d/swap" - else - # squeeze - _FSTAB="/root/etc/fstab" - fi - for _DEVICE in $(echo ${LIVE_SWAP_DEVICES} | sed -e 's|,| |g') do if [ ! -b "${_DEVICE}" ] @@ -57,15 +48,15 @@ Swap () done # Remove all auto swap entries - if grep -qs "swap swap" "${_FSTAB}" + if grep -qs "swap swap" /root/etc/fstab.d/swap then - grep -v "swap swap" "${_FSTAB}" > "${_FSTAB}".tmp - mv "${_FSTAB}".tmp "${_FSTAB}" + grep -v "swap swap" /root/etc/fstab.d/swap > /root/etc/fstab.d/swap.tmp + mv /root/etc/fstab.d/swap.tmp /root/etc/fstab.d/swap fi # Add new swap entries for _DEVICE in ${_SWAP_DEVICES} do - echo "${_DEVICE} swap swap defaults 0 0" >> "${_FSTAB}" + echo "${_DEVICE} swap swap defaults 0 0" >> /root/etc/fstab.d/swap done }