🌴 Sync 2026-03-05 23:51:42

This commit is contained in:
github-actions[bot] committed 2026-03-05 23:51:42 +08:00
1 parent 97c049ed0a
commit 0acff03804
14253 files changed
+3893239

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI Support for oscam
LUCI_DEPENDS:=+luci-compat +oscam
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,15 @@
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
module("luci.controller.oscam", package.seeall)
function index()
if not nixio.fs.access("/etc/config/oscam") then
return
end
local page
page = entry({"admin", "services", "oscam"}, cbi("oscam"), _("OSCAM"), 60)
page.dependent = true
page.acl_depends = { "luci-app-oscam" }
end
+50
View File
@@ -0,0 +1,50 @@
#-- Copyright (C) 2018 dz <dingzhong110@gmail.com>
local sys = require("luci.sys")
local util = require("luci.util")
local fs = require("nixio.fs")
local trport = 8888
local button = ""
if luci.sys.call("pidof oscam >/dev/null") == 0 then
m = Map("oscam", translate("oscam"), "%s - %s" %{translate("oscam"), translate("<strong><font color=\"green\">Running</font></strong>")})
button = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=\"button\" value=\" " .. translate("Open Web Interface") .. " \" onclick=\"window.open('http://'+window.location.hostname+':" .. trport .. "')\"/>"
else
m = Map("oscam", translate("oscam"), "%s - %s" %{translate("oscam"), translate("<strong><font color=\"red\">Not Running</font></strong>")})
end
-- Basic
s = m:section(TypedSection, "oscam", translate("Settings"), translate("General Settings") .. button)
s.anonymous = true
---- Eanble
enable = s:option(Flag, "enabled", translate("Enable"), translate("Enable or disable oscam server"))
enable.default = 0
enable.rmempty = false
-- Doman addresss
s = m:section(TypedSection, "oscam", translate("oscam conf"),
translate("oscam conf"))
s.anonymous = true
---- address
addr = s:option(Value, "address",
translate(""),
translate("-------------------------------------------------------------------- " ..
"----------------------------------------------------------------------------. " ..
""))
addr.template = "cbi/tvalue"
addr.rows = 30
function addr.cfgvalue(self, section)
return nixio.fs.readfile("/etc/oscam/oscam.conf")
end
function addr.write(self, section, value)
value = value:gsub("\r\n?", "\n")
nixio.fs.writefile("/etc/oscam/oscam.conf", value)
end
return m
+1
View File
@@ -0,0 +1 @@
zh_Hans
+32
View File
@@ -0,0 +1,32 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgid "oscam"
msgstr "oscam"
msgid "<strong><font color=\"green\">Running</font></strong>"
msgstr "<strong><font color=\"green\">运行</font></strong>"
msgid "<strong><font color=\"red\">Not Running</font></strong>"
msgstr "<strong><font color=\"red\">未运行</font></strong>"
msgid "Settings"
msgstr "设置"
msgid "General Settings"
msgstr "基本设置"
msgid "Enable"
msgstr "启用"
msgid "Enable or disable oscam server"
msgstr "启用或禁用oscam服务器"
msgid "oscam conf"
msgstr "oscam配置文件"
msgid "oscam server"
msgstr "oscam服务器配置"
msgid "oscam user"
msgstr "oscam用户配置"
+3
View File
@@ -0,0 +1,3 @@
config oscam 'config'
option enabled '0'
@@ -0,0 +1,22 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-oscam.json" ] && {
cat > /usr/share/ucitrack/luci-app-oscam.json << EEOF
{
"config": "oscam",
"init": "oscam"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@oscam[-1]
add ucitrack oscam
set ucitrack.@oscam[-1].init=oscam
commit ucitrack
EOF
/etc/init.d/oscam stop
rm -f /tmp/luci-indexcache
exit 0
@@ -0,0 +1,11 @@
{
"luci-app-oscam": {
"description": "Grant UCI access for luci-app-oscam",
"read": {
"uci": [ "oscam" ]
},
"write": {
"uci": [ "oscam" ]
}
}
}