From 5486c48c370d60126666ad49ecb94400f91ea2e5 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 31 Dec 2012 10:39:47 -0500 Subject: Make sure a device actually exists before trying to act on it. Fixes #2739 --- etc/rc.disable_hdd_apm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/rc.disable_hdd_apm b/etc/rc.disable_hdd_apm index 58f3734..e9b3ba5 100755 --- a/etc/rc.disable_hdd_apm +++ b/etc/rc.disable_hdd_apm @@ -2,6 +2,9 @@ ATAIDLE=/usr/local/sbin/ataidle for i in /dev/ad?; do + if [ ! -e ${i} ]; then + continue; + fi SUPPORTED=`${ATAIDLE} ${i} | grep "APM Supported" | awk '{print $3;}'` if [ "${SUPPORTED}" = "yes" ] ; then echo Disabling APM on $i -- cgit v1.1