diff --git a/luci-app-sunpanel/luasrc/controller/sunpanel.lua b/luci-app-sunpanel/luasrc/controller/sunpanel.lua index 525d62e08..3d90104fc 100644 --- a/luci-app-sunpanel/luasrc/controller/sunpanel.lua +++ b/luci-app-sunpanel/luasrc/controller/sunpanel.lua @@ -16,7 +16,7 @@ function sunpanel_status() local port = tonumber(uci:get_first("sunpanel", "sunpanel", "port")) local status = { - running = (sys.call("pidof sunpanel >/dev/null") == 0), + running = (sys.call("pidof sunpanelbin >/dev/null") == 0), port = (port or 8897) } diff --git a/luci-app-sunpanel/luasrc/model/cbi/sunpanel.lua b/luci-app-sunpanel/luasrc/model/cbi/sunpanel.lua index 3dc989adf..fdad178ff 100644 --- a/luci-app-sunpanel/luasrc/model/cbi/sunpanel.lua +++ b/luci-app-sunpanel/luasrc/model/cbi/sunpanel.lua @@ -4,7 +4,8 @@ local block_model = require "luci.model.sunpanel" 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:") .. ' https://sun-panel-doc.enianteam.com/') m:section(SimpleSection).template = "sunpanel/status" diff --git a/luci-app-sunpanel/po/zh-cn/sunpanel.po b/luci-app-sunpanel/po/zh-cn/sunpanel.po index e69de29bb..838b6da24 100644 --- a/luci-app-sunpanel/po/zh-cn/sunpanel.po +++ b/luci-app-sunpanel/po/zh-cn/sunpanel.po @@ -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 "状态" + diff --git a/sunpanel/files/sunpanel.init b/sunpanel/files/sunpanel.init index 07ba83919..6bef946fe 100755 --- a/sunpanel/files/sunpanel.init +++ b/sunpanel/files/sunpanel.init @@ -2,6 +2,7 @@ START=99 USE_PROCD=1 +NAME=sunpanel get_config() { config_get_bool enabled $1 enabled 0 @@ -10,12 +11,12 @@ get_config() { } start_service() { - config_load sunpanel - config_foreach get_config sunpanel + config_load "$NAME" + config_foreach get_config "$NAME" [ $enabled != 1 ] && return 1 [ -z $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_set_param command /usr/sbin/sunpanelbin -cfgPath $config_path @@ -24,3 +25,17 @@ start_service() { procd_close_instance } +service_triggers() { + procd_add_reload_trigger "$NAME" +} + +reload_service() { + restart +} + +restart() { + stop + sleep 2 + start +} +