Lines 116-123
Link Here
|
116 |
do |
116 |
do |
117 |
# check that the block device really exists |
117 |
# check that the block device really exists |
118 |
# by opening it for reading |
118 |
# by opening it for reading |
119 |
local errmsg=$( : 2>/dev/null <$device ) |
119 |
local errmsg status |
120 |
if [[ -b $device ]] && [[ $? == 0 || $(errmsg) == "*: No medium found" ]] |
120 |
errmsg=$( : 2>&1 <$device ) |
|
|
121 |
status=$? |
122 |
if [[ -b $device ]] && [[ ${status} == 0 || ${errmsg:$((-25))} == "${device}: No medium found" ]] |
121 |
then |
123 |
then |
122 |
eval args=\${`basename $device`_args} |
124 |
eval args=\${`basename $device`_args} |
123 |
do_hdparm |
125 |
do_hdparm |