Skip to content

Commit 8670488

Browse files
Navigate around the binded file
Navigate around the binded file for comparison
1 parent 8cc7335 commit 8670488

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

MerlinAU.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11099,29 +11099,33 @@ _Gnuton_Check_Webs_Update_Script_()
1109911099

1110011100
local theWebsUpdateFile="webs_update.sh"
1110111101
local fixedWebsUpdateFilePath="${SETTINGS_DIR}/$theWebsUpdateFile"
11102+
local tmpFixedWebsUpdateFilePath="${fixedWebsUpdateFilePath}.DL.TMP"
1110211103
local localVerstag=0 remoteVerstag=0
1110311104

11104-
#Get local VERSTAG (if any) #
11105+
#Get local VERSTAG (if any) #
1110511106
localVerstag="$(_GetScriptVerstag_ "$FW_UpdateCheckScript")"
1110611107
[ -z "$localVerstag" ] && localVerstag=0
1110711108

1110811109
# Get the fixed version of the script targeted for Gnuton F/W #
11109-
if _CurlFileDownload_ "gnuton_webs_update.sh" "$fixedWebsUpdateFilePath"
11110+
if _CurlFileDownload_ "gnuton_webs_update.sh" "$tmpFixedWebsUpdateFilePath"
1111011111
then
11111-
chmod 755 "$fixedWebsUpdateFilePath"
11112-
remoteVerstag="$(_GetScriptVerstag_ "$fixedWebsUpdateFilePath")"
11112+
chmod 755 "$tmpFixedWebsUpdateFilePath"
11113+
remoteVerstag="$(_GetScriptVerstag_ "$tmpFixedWebsUpdateFilePath")"
1111311114
[ -z "$remoteVerstag" ] && remoteVerstag=0
1111411115
else
1111511116
return 1 #NOT available so do nothing#
1111611117
fi
1111711118

1111811119
# Only (re)bind if remote is newer OR files differ #
1111911120
if [ "$remoteVerstag" -gt "$localVerstag" ] || \
11120-
! diff "$FW_UpdateCheckScript" "$fixedWebsUpdateFilePath" >/dev/null 2>&1
11121+
! diff "$FW_UpdateCheckScript" "$tmpFixedWebsUpdateFilePath" >/dev/null 2>&1
1112111122
then
1112211123
umount "$FW_UpdateCheckScript" 2>/dev/null
11124+
mv -f "$tmpFixedWebsUpdateFilePath" "$fixedWebsUpdateFilePath"
1112311125
mount -o bind "$fixedWebsUpdateFilePath" "$FW_UpdateCheckScript"
1112411126
Say "${YLWct}Set up a fixed version of the \"${theWebsUpdateFile}\" script file.${NOct}"
11127+
else
11128+
rm -f "$tmpFixedWebsUpdateFilePath"
1112511129
fi
1112611130
}
1112711131

0 commit comments

Comments
 (0)