Make sure a device actually exists before trying to act on it. Fixes #2739

This commit is contained in:
jim-p 2012-12-31 10:39:47 -05:00
parent 0e39c30376
commit b08e147f43
1 changed files with 3 additions and 0 deletions

View File

@ -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