diff options
| author | Daniel Baumann <daniel@debian.org> | 2009-04-09 09:51:12 +0200 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 17:48:04 +0100 |
| commit | 9029bd2c16e6de94174cec967bed8ec462987a3d (patch) | |
| tree | 586c840e3925c84e7d862a38fd9279c51c552738 /scripts | |
| parent | 836bfeaa36798b065260ca0b4ecd195f5650ca66 (diff) | |
| download | live-boot-9029bd2c16e6de94174cec967bed8ec462987a3d.tar.gz live-boot-9029bd2c16e6de94174cec967bed8ec462987a3d.zip | |
Making sure that old swap entries are removed before new ones are added.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/live-bottom/12fstab | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/live-bottom/12fstab b/scripts/live-bottom/12fstab index be78e77..22c11a0 100755 --- a/scripts/live-bottom/12fstab +++ b/scripts/live-bottom/12fstab @@ -77,12 +77,17 @@ then fi done + # Remove all auto swap entries + if grep -qs "swap swap" "${FSTAB}" + then + grep -v "swap swap" "${FSTAB}" > "${FSTAB}".tmp + mv "${FSTAB}".tmp "${FSTAB}" + fi + + # Add new swap entries for device in ${devices} do - if ! grep -qs "^${device} swap" "${FSTAB}" - then - echo "${device} swap swap defaults 0 0" >> "${FSTAB}" - fi + echo "${device} swap swap defaults 0 0" >> "${FSTAB}" done fi |
