From 7fc6f53db188634630fcaa1f8099ab8377fcf634 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 19 May 2019 22:42:20 -0700 Subject: [PATCH] luci-app-kodexplorer: fix path error --- package/lean/luci-app-kodexplorer/Makefile | 4 ++-- .../luasrc/controller/kodexplorer.lua | 6 ++---- .../luasrc/model/cbi/kodexplorer/api.lua | 9 +++------ .../luasrc/view/kodexplorer/download.htm | 2 +- .../luasrc/view/kodexplorer/status.htm | 5 ----- .../luci-app-kodexplorer/root/etc/config/kodexplorer | 2 +- .../luci-app-kodexplorer/root/etc/init.d/kodexplorer | 2 +- .../root/etc/uci-defaults/luci-app-kodexplorer | 0 8 files changed, 10 insertions(+), 20 deletions(-) mode change 100644 => 100755 package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer mode change 100644 => 100755 package/lean/luci-app-kodexplorer/root/etc/uci-defaults/luci-app-kodexplorer diff --git a/package/lean/luci-app-kodexplorer/Makefile b/package/lean/luci-app-kodexplorer/Makefile index a1519b620..ee9cbc305 100644 --- a/package/lean/luci-app-kodexplorer/Makefile +++ b/package/lean/luci-app-kodexplorer/Makefile @@ -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 diff --git a/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua b/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua index 95cd37903..9907e281d 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua +++ b/package/lean/luci-app-kodexplorer/luasrc/controller/kodexplorer.lua @@ -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 diff --git a/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua b/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua index a0aeb478c..dff82e570 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua +++ b/package/lean/luci-app-kodexplorer/luasrc/model/cbi/kodexplorer/api.lua @@ -1,6 +1,3 @@ --- Copyright 2018 Lienol --- 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.*") diff --git a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm index e60150f09..3b1e3e178 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm +++ b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/download.htm @@ -1,5 +1,5 @@ <%# - Copyright 2018 + Copyright (C) 2018-2019 Lienol Licensed to the public under the Apache License 2.0. -%> diff --git a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/status.htm b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/status.htm index 124365bcd..1ce7dd443 100644 --- a/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/status.htm +++ b/package/lean/luci-app-kodexplorer/luasrc/view/kodexplorer/status.htm @@ -1,8 +1,3 @@ -<%# - Copyright 2018 Lienol - Licensed to the public under the Apache License 2.0. --%> - <% local dsp = require "luci.dispatcher" -%> diff --git a/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer b/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer index 6ed0b7454..323bc42dc 100644 --- a/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer +++ b/package/lean/luci-app-kodexplorer/root/etc/config/kodexplorer @@ -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' diff --git a/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer b/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer old mode 100644 new mode 100755 index cbc20d015..2431496ea --- a/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer +++ b/package/lean/luci-app-kodexplorer/root/etc/init.d/kodexplorer @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2018 Lienol +# Copyright (C) 2018-2019 Lienol START=99 diff --git a/package/lean/luci-app-kodexplorer/root/etc/uci-defaults/luci-app-kodexplorer b/package/lean/luci-app-kodexplorer/root/etc/uci-defaults/luci-app-kodexplorer old mode 100644 new mode 100755