From 21df148508c36e212db01c2655ae854f9eb659e5 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 3 Sep 2003 23:27:12 +0000 Subject: check for /proc/swaps before awking it (#99373, ) --- rc.d/init.d/halt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rc.d/init.d') 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 -- cgit v1.2.1