diff --git a/1_4.h13_bugFix/1-4.optm_mand_upgrade/bs_index.lua b/1_4.h13_bugFix/1-4.optm_mand_upgrade/bs_index.lua new file mode 100644 index 0000000..11cb6b4 --- /dev/null +++ b/1_4.h13_bugFix/1-4.optm_mand_upgrade/bs_index.lua @@ -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 + + diff --git a/1_4.h13_bugFix/1-4.optm_mand_upgrade/mzrts_monitor.sh b/1_4.h13_bugFix/1-4.optm_mand_upgrade/mzrts_monitor.sh new file mode 100755 index 0000000..81e34f4 --- /dev/null +++ b/1_4.h13_bugFix/1-4.optm_mand_upgrade/mzrts_monitor.sh @@ -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 + +} + +