diff --git a/vendor/easy-asterisk/docker/entrypoint.sh b/vendor/easy-asterisk/docker/entrypoint.sh index 1cadc6d..943b3d6 100755 --- a/vendor/easy-asterisk/docker/entrypoint.sh +++ b/vendor/easy-asterisk/docker/entrypoint.sh @@ -431,8 +431,15 @@ fi chown -R asterisk:asterisk /etc/asterisk /var/lib/asterisk /var/log/asterisk /var/spool/asterisk /var/run/asterisk 2>/dev/null || true # ── 10. Start Web Admin in background ───────────────────────── -# The web admin script is generated by the 'easy-asterisk' management tool. -# On first run: docker exec -it easy-asterisk easy-asterisk → Web Admin menu → Start +# The web admin script is generated by the 'easy-asterisk' management tool, +# but it only lives in the container's writable layer (not baked into the +# image or bind-mounted), so it's gone every time the container is +# recreated. Regenerate it unconditionally instead of only starting it if +# it happens to already exist — otherwise the web admin never comes back +# on its own after a restart, requiring a manual CLI trip every time. +if [[ -x /usr/local/bin/easy-asterisk ]]; then + /usr/local/bin/easy-asterisk --write-web-admin-script >/dev/null 2>&1 || true +fi if [[ -f "$WEB_ADMIN_SCRIPT" ]]; then log_info "Starting Web Admin on port ${WEB_ADMIN_PORT:-8080}..." WEBADMIN_PORT="${WEB_ADMIN_PORT:-8080}" \ diff --git a/vendor/easy-asterisk/easy-asterisk-v0.10.0.sh b/vendor/easy-asterisk/easy-asterisk-v0.10.0.sh index 3cd0981..4aad948 100755 --- a/vendor/easy-asterisk/easy-asterisk-v0.10.0.sh +++ b/vendor/easy-asterisk/easy-asterisk-v0.10.0.sh @@ -7024,4 +7024,16 @@ if [[ "${1:-}" == "--rebuild-dialplan" ]]; then exit 0 fi +# Non-interactive entry point used by the container entrypoint on every +# start. create_web_admin_script() writes /usr/local/bin/easy-asterisk- +# webadmin, but that file lives only in the container's writable layer — +# it isn't baked into the image or bind-mounted anywhere — so it's wiped +# on every recreate. Without regenerating it here, the web admin only +# ever starts after someone manually runs it once from the interactive +# CLI menu, which defeats the point of it auto-starting at all. +if [[ "${1:-}" == "--write-web-admin-script" ]]; then + create_web_admin_script + exit 0 +fi + main "$@"