aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-09-03 23:27:12 +0000
committerBill Nottingham <notting@redhat.com>2003-09-03 23:27:12 +0000
commit21df148508c36e212db01c2655ae854f9eb659e5 (patch)
treeef405ce6ab04566159648b3f272fbd7cd4a638f1
parent5995871a035dc8e1d2129d48a1e2e390e6cf4533 (diff)
downloadinitscripts-21df148508c36e212db01c2655ae854f9eb659e5.tar
initscripts-21df148508c36e212db01c2655ae854f9eb659e5.tar.gz
initscripts-21df148508c36e212db01c2655ae854f9eb659e5.tar.bz2
initscripts-21df148508c36e212db01c2655ae854f9eb659e5.tar.xz
initscripts-21df148508c36e212db01c2655ae854f9eb659e5.zip
check for /proc/swaps before awking it (#99373, <daniel.blueman@gmx.net>)
-rwxr-xr-xrc.d/init.d/halt2
1 files changed, 1 insertions, 1 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index 9063feda..dfb9178d 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -115,7 +115,7 @@ esac
runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
# Turn off swap, then unmount file systems.
-SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps`
+[ -f /proc/swaps ] && SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps`
[ -n "$SWAPS" ] && runcmd $"Turning off swap: " swapoff $SWAPS
[ -x /sbin/quotaoff ] && runcmd $"Turning off quotas: " /sbin/quotaoff -aug