summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/hdparm/files/hdparm-init-76
1 files changed, 4 insertions, 2 deletions
diff --git a/sys-apps/hdparm/files/hdparm-init-7 b/sys-apps/hdparm/files/hdparm-init-7
index 56263f074fc2..231d42021d47 100644
--- a/sys-apps/hdparm/files/hdparm-init-7
+++ b/sys-apps/hdparm/files/hdparm-init-7
@@ -116,8 +116,10 @@ start() {
do
# check that the block device really exists
# by opening it for reading
- local errmsg=$( : 2>/dev/null <$device )
- if [[ -b $device ]] && [[ $? == 0 || $(errmsg) == "*: No medium found" ]]
+ local errmsg status
+ errmsg=$(: 2>&1 <$device)
+ status=$?
+ if [[ -b $device ]] && [[ ${status} == 0 || ${errmsg} == *": No medium found" ]]
then
eval args=\${`basename $device`_args}
do_hdparm