optm_mand_upgrade

This commit is contained in:
JamesonHuang 2015-07-02 22:56:14 +08:00
parent a35331f35d
commit 24ba89d842
2 changed files with 39 additions and 0 deletions

View 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

View 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
}