luci-app-kodexplorer: fix path error

This commit is contained in:
LEAN-ESX 2019-05-19 22:42:20 -07:00
parent 1e43884bca
commit 7fc6f53db1
8 changed files with 10 additions and 20 deletions

View File

@ -1,4 +1,4 @@
# Copyright (C) 2018 Lienol
# Copyright (C) 2018-2019 Lienol
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for KodExplorer
LUCI_DEPENDS:=+nginx +zoneinfo-asia +php7 +php7-fpm +php7-mod-curl +php7-mod-gd +php7-mod-iconv +php7-mod-json +php7-mod-mbstring +php7-mod-opcache +php7-mod-session +php7-mod-zip
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=2-20181208
PKG_RELEASE:=5-20190518
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -21,11 +21,9 @@ local function http_write_json(content)
end
function act_status()
local nginx="nginx"
local php_fpm="php-fpm"
local e={}
e.nginx_status=luci.sys.call("ps | grep -v grep | grep '"..nginx.."' >/dev/null")==0
e.php_status=luci.sys.call("ps | grep -v grep | grep '"..php_fpm.."' >/dev/null")==0
e.nginx_status=luci.sys.call("ps -w | grep nginx | grep kodexplorer | grep -v grep > /dev/null") == 0
e.php_status=luci.sys.call("ps -w | grep php | grep kodexplorer | grep -v grep > /dev/null") == 0
http_write_json(e)
end

View File

@ -1,6 +1,3 @@
-- Copyright 2018 Lienol <lienol@qq.com>
-- Licensed to the public under the Apache License 2.0.
local fs = require "nixio.fs"
local sys = require "luci.sys"
local uci = require "luci.model.uci".cursor()
@ -115,8 +112,8 @@ local function get_api_json(url)
return jsonc.parse(json_content) or { }
end
function get_config_option(option, default)
return uci:get("kcptun", "general", option) or default
function get_project_directory()
return uci:get("kodexplorer", "global", "project_directory") or luci.sys.exec("echo -n `uci get kodexplorer.@global[0].project_directory`")
end
function to_check()
@ -211,7 +208,7 @@ function to_move(file)
}
end
local client_file = get_config_option("storage_directory", "/mnt/sda1/kodexplorer")
local client_file = get_project_directory()
sys.call("mkdir -p "..client_file)
sys.call("cp -R "..file.."/KodExplorer*/* "..client_file)
sys.call("/bin/rm -rf /tmp/kodexplorer_extract.*")

View File

@ -1,5 +1,5 @@
<%#
Copyright 2018 <lienol@qq.com>
Copyright (C) 2018-2019 Lienol
Licensed to the public under the Apache License 2.0.
-%>

View File

@ -1,8 +1,3 @@
<%#
Copyright 2018 Lienol
Licensed to the public under the Apache License 2.0.
-%>
<%
local dsp = require "luci.dispatcher"
-%>

View File

@ -1,6 +1,6 @@
config global
option port '81'
option port '8081'
option memory_limit '8M'
option post_max_size '12M'
option upload_max_filesize '12M'

View File

@ -1,5 +1,5 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2018 Lienol <admin@lienol.cn>
# Copyright (C) 2018-2019 Lienol
START=99