mirror of
https://github.com/kenzok8/small-package
synced 2025-01-07 09:16:47 +08:00
update 2024-02-23 13:47:31
This commit is contained in:
parent
fc543b3a43
commit
88f295b584
@ -16,7 +16,7 @@ function sunpanel_status()
|
|||||||
local port = tonumber(uci:get_first("sunpanel", "sunpanel", "port"))
|
local port = tonumber(uci:get_first("sunpanel", "sunpanel", "port"))
|
||||||
|
|
||||||
local status = {
|
local status = {
|
||||||
running = (sys.call("pidof sunpanel >/dev/null") == 0),
|
running = (sys.call("pidof sunpanelbin >/dev/null") == 0),
|
||||||
port = (port or 8897)
|
port = (port or 8897)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
local block_model = require "luci.model.sunpanel"
|
local block_model = require "luci.model.sunpanel"
|
||||||
local m, s, o
|
local m, s, o
|
||||||
|
|
||||||
m = Map("sunpanel", translate("SunPanel"), translate("Server, NAS navigation panel, Homepage, Browser homepage."))
|
m = Map("sunpanel", translate("SunPanel"), translate("Server, NAS navigation panel, Homepage, Browser homepage. Login:") .. "admin@sun.cc/12345678"
|
||||||
|
.. translate("Official website:") .. ' <a href=\"https://sun-panel-doc.enianteam.com/\" target=\"_blank\">https://sun-panel-doc.enianteam.com/</a>')
|
||||||
|
|
||||||
m:section(SimpleSection).template = "sunpanel/status"
|
m:section(SimpleSection).template = "sunpanel/status"
|
||||||
|
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
msgid ""
|
||||||
|
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||||
|
|
||||||
|
msgid "Official website:"
|
||||||
|
msgstr "官方网站:"
|
||||||
|
|
||||||
|
msgid "Config path"
|
||||||
|
msgstr "配置文件路径"
|
||||||
|
|
||||||
|
msgid "Service Status"
|
||||||
|
msgstr "服务状态"
|
||||||
|
|
||||||
|
msgid "Server, NAS navigation panel, Homepage, Browser homepage. Login:"
|
||||||
|
msgstr "一个好看的NAS导航页,登录:"
|
||||||
|
|
||||||
|
msgid "Global settings"
|
||||||
|
msgstr "全局配置"
|
||||||
|
|
||||||
|
msgid "Status"
|
||||||
|
msgstr "状态"
|
||||||
|
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
START=99
|
START=99
|
||||||
USE_PROCD=1
|
USE_PROCD=1
|
||||||
|
NAME=sunpanel
|
||||||
|
|
||||||
get_config() {
|
get_config() {
|
||||||
config_get_bool enabled $1 enabled 0
|
config_get_bool enabled $1 enabled 0
|
||||||
@ -10,12 +11,12 @@ get_config() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_service() {
|
start_service() {
|
||||||
config_load sunpanel
|
config_load "$NAME"
|
||||||
config_foreach get_config sunpanel
|
config_foreach get_config "$NAME"
|
||||||
[ $enabled != 1 ] && return 1
|
[ $enabled != 1 ] && return 1
|
||||||
[ -z $config_path ] && return 1
|
[ -z $config_path ] && return 1
|
||||||
[ ! -d $config_path ] && return 1
|
[ ! -d $config_path ] && return 1
|
||||||
lua /usr/libexec/istorec/sunpanel_conf.lua sunpanel /usr/share/sunpanel/conf.temp $config_path/conf.ini
|
lua /usr/libexec/istorec/sunpanel_conf.lua $NAME /usr/share/$NAME/conf.temp $config_path/conf.ini
|
||||||
|
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
procd_set_param command /usr/sbin/sunpanelbin -cfgPath $config_path
|
procd_set_param command /usr/sbin/sunpanelbin -cfgPath $config_path
|
||||||
@ -24,3 +25,17 @@ start_service() {
|
|||||||
procd_close_instance
|
procd_close_instance
|
||||||
}
|
}
|
||||||
|
|
||||||
|
service_triggers() {
|
||||||
|
procd_add_reload_trigger "$NAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
|
restart
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop
|
||||||
|
sleep 2
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user