From 24ba89d8426afc9f47c66de102828fbaec9380ab Mon Sep 17 00:00:00 2001 From: JamesonHuang Date: Thu, 2 Jul 2015 22:56:14 +0800 Subject: [PATCH] optm_mand_upgrade --- .../1-4.optm_mand_upgrade/bs_index.lua | 10 +++++++ .../1-4.optm_mand_upgrade/mzrts_monitor.sh | 29 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 1_4.h13_bugFix/1-4.optm_mand_upgrade/bs_index.lua create mode 100755 1_4.h13_bugFix/1-4.optm_mand_upgrade/mzrts_monitor.sh 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 + +} + +