Skip to content

Commit

Permalink
Making sure that old swap entries are removed before new ones are added.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-baumann committed Apr 9, 2009
1 parent d073b79 commit d834f11
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/live-bottom/12fstab
Expand Up @@ -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

Expand Down

0 comments on commit d834f11

Please sign in to comment.