diff options
Diffstat (limited to 'network/open-iscsi/doinst.sh')
-rw-r--r-- | network/open-iscsi/doinst.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/network/open-iscsi/doinst.sh b/network/open-iscsi/doinst.sh index 718295b2e7..a4797f0184 100644 --- a/network/open-iscsi/doinst.sh +++ b/network/open-iscsi/doinst.sh @@ -1,16 +1,19 @@ +# 20230620 bkw: reverted this to the config() function from SBo +# template. Please leave this as-is. It works, and it won't confuse +# us (we have over 8000 scripts to look after...) config() { - NEW="${1}.new" - OLD="$1" + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD - elif [ "$(md5sum <$OLD)" = "$(md5sum <$NEW)" ]; then + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } -config etc/iscsi/iscsid.conf -config etc/iscsi/initiatorname.iscsi +config etc/iscsi/iscsid.conf.new +config etc/iscsi/initiatorname.iscsi.new |