Skip to content

Commit f26ba29

Browse files
Workaround for Bound File
Workaround for Bound File
1 parent 8670488 commit f26ba29

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

MerlinAU.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,7 +2688,13 @@ _CurlFileDownload_()
26882688
then updatedWebUIPage=true
26892689
else updatedWebUIPage=false
26902690
fi
2691-
mv -f "$tempFilePathDL" "$2"
2691+
if grep -q " $2 " /proc/mounts 2>/dev/null
2692+
then
2693+
cat "$tempFilePathDL" > "$2"
2694+
rm -f "$tempFilePathDL"
2695+
else
2696+
mv -f "$tempFilePathDL" "$2"
2697+
fi
26922698
retCode=0
26932699
fi
26942700

@@ -11099,33 +11105,32 @@ _Gnuton_Check_Webs_Update_Script_()
1109911105

1110011106
local theWebsUpdateFile="webs_update.sh"
1110111107
local fixedWebsUpdateFilePath="${SETTINGS_DIR}/$theWebsUpdateFile"
11102-
local tmpFixedWebsUpdateFilePath="${fixedWebsUpdateFilePath}.DL.TMP"
1110311108
local localVerstag=0 remoteVerstag=0
1110411109

1110511110
#Get local VERSTAG (if any) #
1110611111
localVerstag="$(_GetScriptVerstag_ "$FW_UpdateCheckScript")"
1110711112
[ -z "$localVerstag" ] && localVerstag=0
1110811113

11114+
umount "$FW_UpdateCheckScript" 2>/dev/null
1110911115
# Get the fixed version of the script targeted for Gnuton F/W #
11110-
if _CurlFileDownload_ "gnuton_webs_update.sh" "$tmpFixedWebsUpdateFilePath"
11116+
if _CurlFileDownload_ "gnuton_webs_update.sh" "$fixedWebsUpdateFilePath"
1111111117
then
11112-
chmod 755 "$tmpFixedWebsUpdateFilePath"
11113-
remoteVerstag="$(_GetScriptVerstag_ "$tmpFixedWebsUpdateFilePath")"
11118+
chmod 755 "$fixedWebsUpdateFilePath"
11119+
remoteVerstag="$(_GetScriptVerstag_ "$fixedWebsUpdateFilePath")"
1111411120
[ -z "$remoteVerstag" ] && remoteVerstag=0
1111511121
else
1111611122
return 1 #NOT available so do nothing#
1111711123
fi
1111811124

1111911125
# Only (re)bind if remote is newer OR files differ #
1112011126
if [ "$remoteVerstag" -gt "$localVerstag" ] || \
11121-
! diff "$FW_UpdateCheckScript" "$tmpFixedWebsUpdateFilePath" >/dev/null 2>&1
11127+
! diff "$FW_UpdateCheckScript" "$fixedWebsUpdateFilePath" >/dev/null 2>&1
1112211128
then
1112311129
umount "$FW_UpdateCheckScript" 2>/dev/null
11124-
mv -f "$tmpFixedWebsUpdateFilePath" "$fixedWebsUpdateFilePath"
1112511130
mount -o bind "$fixedWebsUpdateFilePath" "$FW_UpdateCheckScript"
1112611131
Say "${YLWct}Set up a fixed version of the \"${theWebsUpdateFile}\" script file.${NOct}"
1112711132
else
11128-
rm -f "$tmpFixedWebsUpdateFilePath"
11133+
rm -f "$fixedWebsUpdateFilePath"
1112911134
fi
1113011135
}
1113111136

0 commit comments

Comments
 (0)