all: fix port detection

This commit is contained in:
jjm2473
2023-06-19 13:07:16 +08:00
parent 018b929a77
commit d5d9710a10
25 changed files with 34 additions and 42 deletions

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.0.1-20230108
PKG_VERSION:=1.0.2-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for Emby

View File

@@ -18,7 +18,7 @@ local container_running = container_status == "running"
if container_running then
local port=util.trim(util.exec("/usr/libexec/istorec/emby.sh port"))
if port == "" then
port="8097"
port="8096"
end
-%>
<div class="cbi-value cbi-value-last">

View File

@@ -39,3 +39,6 @@ msgstr "打开 Emby"
msgid "Not required, all disk is mounted in"
msgstr "可不填,所有硬盘都在"
msgid "Emby running in host network, for DLNA application, port is always 8096 if enabled"
msgstr "在宿主网络运行 Emby以支持 DLNA 等应用例如投屏如果启用则端口固定为8096需注意端口与 Jellyfin 冲突"

View File

@@ -84,7 +84,7 @@ case ${ACTION} in
docker ps --all -f 'name=emby' --format '{{.State}}'
;;
"port")
docker ps --all -f 'name=emby' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
docker ps --all -f 'name=emby' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8096/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
;;
*)
usage

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.1.7-20230108
PKG_VERSION:=1.1.8-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for jellyfin

View File

@@ -38,7 +38,7 @@ msgid "Host network"
msgstr "宿主网络"
msgid "Jellyfin running in host network, for DLNA application, port is always 8096 if enabled"
msgstr "在宿主网络运行 Jellyfin以支持 DLNA 等应用例如投屏如果启用则端口固定为8096"
msgstr "在宿主网络运行 Jellyfin以支持 DLNA 等应用例如投屏如果启用则端口固定为8096,需注意端口与 Emby 冲突"
msgid "Default use 'transcodes' in 'config path' if not set, please make sure there has enough space"
msgstr "留空则使用配置文件路径下的 transcodes请确保有足够空间"

View File

@@ -142,7 +142,7 @@ case ${ACTION} in
docker ps --all -f 'name=jellyfin' --format '{{.State}}'
;;
"port")
docker ps --all -f 'name=jellyfin' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
docker ps --all -f 'name=jellyfin' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8096/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
;;
*)
usage

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.0.1-20230108
PKG_VERSION:=1.0.2-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for Owntone

View File

@@ -18,7 +18,7 @@ s = m:section(TypedSection, "main", translate("Setup"), translate("The following
s.addremove=false
s.anonymous=true
o = s:option(Value, "image_name", translate("Image").."<b>*</b>", translate("Owntone only works in host network"))
o = s:option(Value, "image_name", translate("Image").."<b>*</b>", translate("Owntone only works in host network with port 3689"))
o.rmempty = false
o.datatype = "string"
o:value("lscr.io/linuxserver/daapd:latest", "lscr.io/linuxserver/daapd:latest")

View File

@@ -34,5 +34,5 @@ msgstr "Owntone 未运行"
msgid "Open Owntone"
msgstr "打开 Owntone"
msgid "Owntone only works in host network"
msgstr "Owntone 只工作在 Host 网络"
msgid "Owntone only works in host network with port 3689"
msgstr "Owntone 只工作在宿主网络,管理端口 3689"

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.0.1-20230108
PKG_VERSION:=1.0.2-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for PhotoPrism

View File

@@ -23,7 +23,6 @@ o = s:option(Value, "http_port", translate("HTTP Port").."<b>*</b>")
o.rmempty = false
o.default = "2342"
o.datatype = "string"
o:depends("hostnet", 0)
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false

View File

@@ -67,7 +67,7 @@ case ${ACTION} in
docker ps --all -f 'name=photoprism' --format '{{.State}}'
;;
"port")
docker ps --all -f 'name=photoprism' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
docker ps --all -f 'name=photoprism' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->2342/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
;;
*)
usage

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.0.1-20230108
PKG_VERSION:=1.0.2-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for Plex

View File

@@ -98,9 +98,7 @@ case ${ACTION} in
docker ps --all -f 'name=plex' --format '{{.State}}'
;;
"port")
local port=`docker ps --all -f 'name=plex' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->32400/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'`
[ -z "$port" ] && port=32400
echo $port
docker ps --all -f 'name=plex' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->32400/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
;;
*)
usage

View File

@@ -18,7 +18,7 @@ s = m:section(TypedSection, "main", translate("Setup"), translate("The following
s.addremove=false
s.anonymous=true
o = s:option(Flag, "hostnet", translate("Host network"), translate("UnifiController running in host network, for DLNA application, port is always 8096 if enabled"))
o = s:option(Flag, "hostnet", translate("Host network"), translate("UnifiController running in host network, port is always 8443 if enabled"))
o.default = 0
o.rmempty = false

View File

@@ -18,7 +18,7 @@ local container_running = container_status == "running"
if container_running then
local port=util.trim(util.exec("/usr/libexec/istorec/unifi.sh port"))
if port == "" then
port="8083"
port="8443"
end
-%>
<div class="cbi-value cbi-value-last">

View File

@@ -37,5 +37,5 @@ msgstr "UnifiController 未运行"
msgid "Open UnifiController"
msgstr "打开 UnifiController"
msgid "Not required, all disk is mounted in"
msgstr "可不填,所有硬盘都在"
msgid "UnifiController running in host network, port is always 8443 if enabled"
msgstr "在宿主网络运行 UnifiController如果启用则端口固定为8443注意此端口可能与其他应用冲突"

View File

@@ -75,14 +75,7 @@ case ${ACTION} in
docker ps --all -f 'name=unifi' --format '{{.State}}'
;;
"port")
local hostnet=`uci get -q unifi.@main[0].hostnet 2>/dev/null`
if [ "$hostnet" = 1 ]; then
echo 8443
else
local http_port=`uci get -q unifi.@main[0].http_port 2>/dev/null`
[ -z "$http_port" ] && http_port=8083
echo $http_port
fi
docker ps --all -f 'name=unifi' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->8443/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
;;
*)
usage

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.0.1-20230108
PKG_VERSION:=1.0.2-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for Xteve

View File

@@ -26,7 +26,6 @@ s.anonymous=true
o = s:option(Value, "port", translate("Port").."<b>*</b>")
o.default = "32400"
o.datatype = "port"
o:depends("hostnet", 0)
o = s:option(Value, "image_name", translate("Image").."<b>*</b>")
o.rmempty = false

View File

@@ -2,7 +2,7 @@
include $(TOPDIR)/rules.mk
PKG_VERSION:=1.0.1-20230108
PKG_VERSION:=1.0.2-20230619
PKG_RELEASE:=
LUCI_TITLE:=LuCI support for Xunlei

View File

@@ -18,7 +18,7 @@ s = m:section(TypedSection, "main", translate("Setup"), translate("The following
s.addremove=false
s.anonymous=true
o = s:option(Flag, "hostnet", translate("Host network"), translate("Xunlei running in host network, for DLNA application, port is always 32400 if enabled"))
o = s:option(Flag, "hostnet", translate("Host network"), translate("Xunlei running in host network, port is always 2345 if enabled"))
o.default = 0
o.rmempty = false

View File

@@ -5,10 +5,10 @@ msgid "Official website:"
msgstr "官方网站:"
msgid "Xunlei"
msgstr "Xunlei下载"
msgstr "迅雷下载"
msgid "Xunlei is an download tool, made by Xunlei, Inc."
msgstr "Xunlei 是一个下载工具。"
msgstr "迅雷是一个迅雷公司出品下载工具。"
msgid "Config path"
msgstr "配置文件路径"
@@ -26,7 +26,7 @@ msgid "Service Status"
msgstr "服务状态"
msgid "Xunlei status:"
msgstr "Xunlei 的状态信息如下:"
msgstr "迅雷的状态信息如下:"
msgid "Setup"
msgstr "安装配置"
@@ -38,13 +38,13 @@ msgid "Status"
msgstr "状态"
msgid "Xunlei is running"
msgstr "Xunlei 运行中"
msgstr "迅雷运行中"
msgid "Xunlei is not running"
msgstr "Xunlei 未运行"
msgstr "迅雷未运行"
msgid "Open Xunlei"
msgstr "打开 Xunlei"
msgstr "打开迅雷"
msgid "Not required, all disk is mounted in"
msgstr "可不填,所有硬盘都在"
msgid "Xunlei running in host network, port is always 2345 if enabled"
msgstr "在宿主网络运行迅雷,如果启用则端口固定为 2345"

View File

@@ -73,7 +73,7 @@ case ${ACTION} in
docker ps --all -f 'name=xunlei' --format '{{.State}}'
;;
"port")
docker ps --all -f 'name=xunlei' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
docker ps --all -f 'name=xunlei' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*->2345/tcp' | sed 's/0.0.0.0:\([0-9]*\)->.*/\1/'
;;
*)
usage