mirror of
https://github.com/JamesonHuang/OpenWrt_Luci_Lua.git
synced 2024-11-23 13:50:11 +00:00
optm_mand_upgrade
This commit is contained in:
parent
a35331f35d
commit
24ba89d842
10
1_4.h13_bugFix/1-4.optm_mand_upgrade/bs_index.lua
Normal file
10
1_4.h13_bugFix/1-4.optm_mand_upgrade/bs_index.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
local posix = require "Posix"
|
||||||
|
|
||||||
|
function test_timeout()
|
||||||
|
--posix.sleep(5)
|
||||||
|
local ret = {}
|
||||||
|
ret["result"] = true
|
||||||
|
luci.http.write_json(ret)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
29
1_4.h13_bugFix/1-4.optm_mand_upgrade/mzrts_monitor.sh
Executable file
29
1_4.h13_bugFix/1-4.optm_mand_upgrade/mzrts_monitor.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
check_mandatory_upgrade()
|
||||||
|
{
|
||||||
|
echo "check_mandatory_upgrade"
|
||||||
|
touch /tmp/is_upgrading
|
||||||
|
#gen random_num
|
||||||
|
min=1
|
||||||
|
max=$((3600-$min+1))
|
||||||
|
num=$(date +%s)
|
||||||
|
random_num=$(($num%$max+$min))
|
||||||
|
#end
|
||||||
|
sleep ${random_num}
|
||||||
|
lua -e 'require("meizu.upgdfs").check_mandatory_upgrade()'
|
||||||
|
echo "mandatory_upgrade success!"
|
||||||
|
rm /tmp/is_upgrading
|
||||||
|
}
|
||||||
|
|
||||||
|
mzrts_monitor()
|
||||||
|
{
|
||||||
|
|
||||||
|
if [ ${timers} -ge 18 ] && [ ${timers} -le 19 ];then
|
||||||
|
if [ ! -f "/tmp/is_upgrading" ];then
|
||||||
|
check_mandatory_upgrade &
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user