This commit is contained in:
Striker72rus 2026-03-25 15:49:33 +03:00
parent 2afc09b644
commit 1e599fe221
3 changed files with 17 additions and 3 deletions

9
run.sh
View File

@ -30,10 +30,17 @@ if [ "$RUNTIME_MODE" = "addon" ]; then
i=0
while [ "$i" -lt 120 ]; do
log "registering ingress attempt $((i + 1))/120"
if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then
output="$(php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' 2>&1)"
status=$?
if [ "$status" -eq 0 ]; then
log "ingress registered"
exit 0
fi
if [ -n "$output" ]; then
printf '%s\n' "$output" | while IFS= read -r line; do
[ -n "$line" ] && log "$line"
done
fi
i=$((i + 1))
sleep 2
done

View File

@ -1,6 +1,6 @@
name: Wall Panel
description: Wall Panel PHP interface as a Home Assistant add-on
version: "1.0.15"
version: "1.0.16"
slug: wall_panel
url: https://git.striker72rus.ru/PHP/wallpanell.git
init: false

View File

@ -28,10 +28,17 @@ log "storage dir: ${STORAGE_DIR}"
i=0
while [ "$i" -lt 120 ]; do
log "registering ingress attempt $((i + 1))/120"
if php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' >/dev/null 2>&1; then
output="$(php -r 'require "/app/lib/bootstrap.php"; $config = app_load_config(); exit(app_register_ingress_url($config) ? 0 : 1);' 2>&1)"
status=$?
if [ "$status" -eq 0 ]; then
log "ingress registered"
exit 0
fi
if [ -n "$output" ]; then
printf '%s\n' "$output" | while IFS= read -r line; do
[ -n "$line" ] && log "$line"
done
fi
i=$((i + 1))
sleep 2
done