mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-05 18:44:03 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,37 @@
|
||||
local m,s,o
|
||||
local SYS = require "luci.sys"
|
||||
|
||||
|
||||
if SYS.call("pidof mproxy >/dev/null") == 0 then
|
||||
Status = translate("<strong><font color=\"green\">Mproxy is Running</font></strong>")
|
||||
else
|
||||
Status = translate("<strong><font color=\"red\">Mproxy is Not Running</font></strong>")
|
||||
end
|
||||
|
||||
m = Map("mproxy")
|
||||
m.title = translate("Mproxy Server")
|
||||
m.description = translate("A mini HTTP/HTTPS Proxy Server for Something")
|
||||
|
||||
s = m:section(TypedSection, "mproxy", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
s.description = translate(string.format("%s<br /><br />", Status))
|
||||
|
||||
enable = s:option(Flag, "enabled", translate("Enable"))
|
||||
enable.default = 0
|
||||
enable.rmempty = false
|
||||
|
||||
port = s:option(Value, "port", translate("Port"))
|
||||
port.datatype = "range(1,65535)"
|
||||
|
||||
redir = s:option(Value, "redir", translate("Redirect to Local Port"))
|
||||
redir.datatype = "range(1,65535)"
|
||||
redir.rmempty = false
|
||||
redir.description = translate("Redirecting traffic incoming to the specified local port")
|
||||
|
||||
function m.on_after_commit(self)
|
||||
os.execute("uci set firewall.mproxy.dest_port=$(uci get mproxy.config.port) && uci commit firewall && /etc/init.d/firewall restart")
|
||||
os.execute("/etc/init.d/mproxy restart")
|
||||
end
|
||||
|
||||
return m
|
||||
Reference in new issue
Block a user