1. 程式人生 > >openWRT學習之LUCI之二訪問controller下lua檔案的函式

openWRT學習之LUCI之二訪問controller下lua檔案的函式

備註:請關注之前的兩篇文章在做下面的工作

entry({"admin", "system", "heyg3"}, call("heyg3"), _("heyg3"), 5).dependent=false

同時在system.lua檔案中新增函式:

--adde by heyg :call                                                                                        

function heyg3()                                                                                            

        luci.http.prepare_content("text/plain")                                                             

        luci.http.write("haha rebootin now...")                                                             

        luci.sys.reboot()                                                                                   

end