Fix Manyfold public hostname detection

This commit is contained in:
Alexandre
2026-07-06 08:52:51 +02:00
parent 9513420051
commit b36ebeab59
2 changed files with 7 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ arch:
startup: services
init: false
hassio_api: true
homeassistant_api: true
ports:
3214/tcp: 3214

View File

@@ -36,7 +36,12 @@ strip_hostname() {
raw="${raw#http://}"
raw="${raw#https://}"
raw="${raw%%/*}"
raw="${raw%%:*}"
if [[ "$raw" =~ ^(\[[^]]+\])(:[0-9]+)?$ ]]; then
raw="${BASH_REMATCH[1]}"
else
raw="${raw%%:*}"
fi
printf '%s\n' "$raw"
}