diff --git a/autoupdater-mod/files/lib/ffnw/autoupdater-mod/autoupdater b/autoupdater-mod/files/lib/ffnw/autoupdater-mod/autoupdater index cc7a0d8396ef4c8cd7bb94b411d1e6f7be1fb5e6..f21403fa065d91b5664a4b636ddeeeffc546c1f8 100755 --- a/autoupdater-mod/files/lib/ffnw/autoupdater-mod/autoupdater +++ b/autoupdater-mod/files/lib/ffnw/autoupdater-mod/autoupdater @@ -31,6 +31,14 @@ function wait(seconds) repeat until os.time() > start + seconds end +function write_new_firmware_version(f_version) + local dateV = os.date() + local fileV = io.open("/root/upgradeV", "a") + fileV:write( f_version .. " | " .. dateV .. '\n') + fileV:close() + return 0 +end + local foreach_count=1 for originator in io.popen(string.format("cat /sys/kernel/debug/batman_adv/bat0/originators"), 'r'):lines() do if foreach_count > 2 then @@ -210,6 +218,8 @@ local function autoupdate(mirror) wait(14400) -- Wait for 4h end + write_new_firmware_version(manifest.version) + os.execute('sync; sysctl -w vm.drop_caches=3') collectgarbage()