Don't set an already set attribute (#826357)

Depending on how the dasd_mod module was loaded, our device could have
already been marked as online or offline.  We need to make the sysecho
sensitive to this and not fail if the attribute we're trying to set has
already been set.
master
Jesse Keating 2012-05-31 18:41:25 -07:00 committed by Harald Hoyer
parent ecc6da6bf5
commit e82e54df2c
1 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,7 @@
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh


function sysecho () { function sysecho () {
file=$1 file="$1"
shift shift
local i=1 local i=1
while [ $i -le 10 ] ; do while [ $i -le 10 ] ; do
@ -16,7 +16,11 @@ function sysecho () {
break break
fi fi
done done
[ -f "$file" ] && echo $* > $file local status
read status < "$file"
if [[ ! $status == $* ]]; then
[ -f "$file" ] && echo $* > "$file"
fi
} }


function dasd_settle() { function dasd_settle() {