From 2e1d1294126180d2efdcdb4634095a34fd7a0c9d Mon Sep 17 00:00:00 2001 From: janson Date: Wed, 15 Feb 2023 17:19:35 +0800 Subject: [PATCH] old version support for nas-tools --- applications/luci-app-chinesesubfinder/Makefile | 2 +- .../root/etc/config/chinesesubfinder | 2 +- applications/luci-app-nastools/Makefile | 2 +- .../luasrc/model/cbi/nastools.lua | 7 +++++++ .../luci-app-nastools/root/etc/config/nastools | 1 + .../root/usr/libexec/istorec/nastools.sh | 17 +++++++---------- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/applications/luci-app-chinesesubfinder/Makefile b/applications/luci-app-chinesesubfinder/Makefile index 23ec3a1..8272190 100644 --- a/applications/luci-app-chinesesubfinder/Makefile +++ b/applications/luci-app-chinesesubfinder/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.0.1-20230108 +PKG_VERSION:=1.0.2-20230215 PKG_RELEASE:= LUCI_TITLE:=LuCI support for ChineseSubFinder diff --git a/applications/luci-app-chinesesubfinder/root/etc/config/chinesesubfinder b/applications/luci-app-chinesesubfinder/root/etc/config/chinesesubfinder index cfeff58..9225703 100644 --- a/applications/luci-app-chinesesubfinder/root/etc/config/chinesesubfinder +++ b/applications/luci-app-chinesesubfinder/root/etc/config/chinesesubfinder @@ -1,6 +1,6 @@ config main option 'http_port' '19035' option 'web_port' '19037' - option 'image_name' 'allanpk716/chinesesubfinder:latest-lite' + option 'image_name' '' option 'config_path' '' diff --git a/applications/luci-app-nastools/Makefile b/applications/luci-app-nastools/Makefile index 2c51c40..a7280ad 100644 --- a/applications/luci-app-nastools/Makefile +++ b/applications/luci-app-nastools/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=1.1.2-20230108 +PKG_VERSION:=1.1.3-20230215 PKG_RELEASE:= LUCI_TITLE:=LuCI support for nastools diff --git a/applications/luci-app-nastools/luasrc/model/cbi/nastools.lua b/applications/luci-app-nastools/luasrc/model/cbi/nastools.lua index c8e88da..dafc0d4 100644 --- a/applications/luci-app-nastools/luasrc/model/cbi/nastools.lua +++ b/applications/luci-app-nastools/luasrc/model/cbi/nastools.lua @@ -23,6 +23,13 @@ o.rmempty = false o.default = "3003" o.datatype = "port" +o = s:option(Value, "image_name", translate("Image").."*") +o.rmempty = false +o.datatype = "string" +o:value("jxxghp/nas-tools", "jxxghp/nas-tools") +o:value("sungamma/nas-tools:2.9.1", "sungamma/nas-tools:2.9.1") +o.default = "sungamma/nas-tools:2.9.1" + local blocks = nastools_model.blocks() local home = nastools_model.home() diff --git a/applications/luci-app-nastools/root/etc/config/nastools b/applications/luci-app-nastools/root/etc/config/nastools index 5e8c5e1..b976f09 100644 --- a/applications/luci-app-nastools/root/etc/config/nastools +++ b/applications/luci-app-nastools/root/etc/config/nastools @@ -2,3 +2,4 @@ config nastools option 'config_path' '' option 'http_port' '3003' option 'auto_upgrade' '0' + option 'image_name' '' diff --git a/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh b/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh index aeb705a..7ad977c 100755 --- a/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh +++ b/applications/luci-app-nastools/root/usr/libexec/istorec/nastools.sh @@ -8,18 +8,15 @@ get_image() { } do_install() { - get_image - echo "docker pull ${IMAGE_NAME}" - docker pull ${IMAGE_NAME} - docker rm -f nastools - - do_install_detail -} - -do_install_detail() { local config=`uci get nastools.@nastools[0].config_path 2>/dev/null` local port=`uci get nastools.@nastools[0].http_port 2>/dev/null` local auto_update=`uci get nastools.@nastools[0].auto_upgrade 2>/dev/null` + local image_name=`uci get nastools.@nastools[0].image_name 2>/dev/null` + + [ -z "$image_name" ] && image_name="sungamma/nas-tools:2.9.1" + echo "docker pull ${image_name}" + docker pull ${image_name} + docker rm -f nastools if [ -z "$config" ]; then echo "config path is empty!" @@ -49,7 +46,7 @@ do_install_detail() { cmd="$cmd -v /mnt:/mnt" mountpoint -q /mnt && cmd="$cmd:rslave" - cmd="$cmd --name nastools \"$IMAGE_NAME\"" + cmd="$cmd --name nastools \"$image_name\"" echo "$cmd" eval "$cmd"