mirror of
https://github.com/kenzok8/small-package.git
synced 2026-02-07 07:18:00 +08:00
update 05-07 23:42:17
This commit is contained in:
7
luci-app-passwall2/root/etc/hotplug.d/iface/98-passwall2
Normal file
7
luci-app-passwall2/root/etc/hotplug.d/iface/98-passwall2
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
[[ "$ACTION" == "ifup" && "$INTERFACE" == "wan" && $(uci get "passwall2.@global[0].enabled") == "1" ]] && {
|
||||
/etc/init.d/passwall2 restart
|
||||
echo "passwall2: restart when wan ifup" > /dev/kmsg
|
||||
}
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
module("luci.controller.serverchan",package.seeall)
|
||||
module("luci.controller.serverchan", package.seeall)
|
||||
|
||||
function index()
|
||||
|
||||
if not nixio.fs.access("/etc/config/serverchan")then
|
||||
if not nixio.fs.access("/etc/config/serverchan") then
|
||||
return
|
||||
end
|
||||
|
||||
local page = entry({"admin", "services", "serverchan"}, alias("admin", "services", "serverchan", "setting"), _("微信推送"), 30)
|
||||
page.dependent = true
|
||||
page.acl_depends = { "luci-app-serverchan" }
|
||||
|
||||
entry({"admin", "services", "serverchan"}, alias("admin", "services", "serverchan", "setting"),_("微信推送"), 30).dependent = true
|
||||
entry({"admin", "services", "serverchan", "setting"}, cbi("serverchan/setting"),_("配置"), 40).leaf = true
|
||||
entry({"admin", "services", "serverchan", "advanced"}, cbi("serverchan/advanced"),_("高级设置"), 50).leaf = true
|
||||
entry({"admin", "services", "serverchan", "client"}, form("serverchan/client"), "在线设备", 80)
|
||||
entry({"admin", "services", "serverchan", "log"}, form("serverchan/log"),_("日志"), 99).leaf = true
|
||||
entry({"admin", "services", "serverchan", "setting"}, cbi("serverchan/setting"), _("配置"), 40).leaf = true
|
||||
entry({"admin", "services", "serverchan", "advanced"}, cbi("serverchan/advanced"), _("高级设置"), 50).leaf = true
|
||||
entry({"admin", "services", "serverchan", "client"}, form("serverchan/client"), _("在线设备"), 80)
|
||||
entry({"admin", "services", "serverchan", "log"}, form("serverchan/log"), _("日志"), 99).leaf = true
|
||||
entry({"admin", "services", "serverchan", "get_log"}, call("get_log")).leaf = true
|
||||
entry({"admin", "services", "serverchan", "clear_log"}, call("clear_log")).leaf = true
|
||||
entry({"admin", "services", "serverchan", "status"}, call("act_status")).leaf=true
|
||||
entry({"admin", "services", "serverchan", "status"}, call("act_status")).leaf = true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("busybox ps|grep -v grep|grep -c serverchan >/dev/null")==0
|
||||
local e = {}
|
||||
e.running = luci.sys.call("busybox ps|grep -v grep|grep -c serverchan >/dev/null") == 0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
function get_log()
|
||||
luci.http.write(luci.sys.exec(
|
||||
"[ -f '/tmp/serverchan/serverchan.log' ] && cat /tmp/serverchan/serverchan.log"))
|
||||
luci.http.write(luci.sys.exec("[ -f '/tmp/serverchan/serverchan.log' ] && cat /tmp/serverchan/serverchan.log"))
|
||||
end
|
||||
|
||||
function clear_log()
|
||||
|
||||
@@ -2,4 +2,8 @@ www.cip.cc
|
||||
ifcfg.cn
|
||||
ddns.oray.com/checkip
|
||||
www.net.cn/static/customercare/yourip.asp
|
||||
myip.ipip.net/s
|
||||
myip.ipip.net/s
|
||||
speed.neu.edu.cn/getIP.php
|
||||
www.uc.cn/ip
|
||||
ifcfg.cn
|
||||
ip.3322.net
|
||||
|
||||
@@ -110,6 +110,7 @@ add_wizard() {
|
||||
|
||||
uci commit wizard
|
||||
uci commit dhcp
|
||||
uci commit firewall
|
||||
uci commit network
|
||||
(
|
||||
/etc/init.d/network restart
|
||||
|
||||
Reference in New Issue
Block a user