old version support for nas-tools

This commit is contained in:
janson
2023-02-15 17:19:35 +08:00
parent eae9bcca30
commit 2e1d129412
6 changed files with 18 additions and 13 deletions

View File

@@ -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

View File

@@ -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' ''

View File

@@ -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

View File

@@ -23,6 +23,13 @@ o.rmempty = false
o.default = "3003"
o.datatype = "port"
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
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()

View File

@@ -2,3 +2,4 @@ config nastools
option 'config_path' ''
option 'http_port' '3003'
option 'auto_upgrade' '0'
option 'image_name' ''

View File

@@ -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"