* grep returns a non-zero exit code if no line matches, causing the

swap task to fail.  So ignore that.

svn path=/nixos/trunk/; revision=19660
This commit is contained in:
Eelco Dolstra 2010-01-26 09:56:53 +00:00
parent 32995b3d36
commit 442093d27d

View File

@ -94,7 +94,7 @@ in
device=$(readlink -f "$device")
# Add new swap devices.
if echo $unused | grep -q "^$device\$"; then
unused="$(echo $unused | grep -v "^$device\$")"
unused="$(echo $unused | grep -v "^$device\$" || true)"
else
${utillinux}/sbin/swapon "$device" || true
fi