From e944a33d8f8b8ab263ba518ebfd95586701fb6ee Mon Sep 17 00:00:00 2001 From: librelad Date: Sun, 24 May 2026 20:43:19 +0100 Subject: [PATCH] feat(uninstall): honor --unattended to skip the confirm prompt runFullUninstall always prompted for `DELETE LIBREPORTAL`, so it couldn't be driven non-interactively. Honor the existing global --unattended flag (init_unattended_mode) to skip the prompt; an interactive `init.sh uninstall` still requires it. This lets the deploy helper do a clean teardown (`init.sh --unattended uninstall`) for a full reinstall instead of `rm -rf /docker`. The brute wipe left the task-processor systemd service running against a deleted runtime dir; init.sh's idempotent service setup then saw an unchanged unit and skipped the restart, so the reinstalled WebUI container was never started. The uninstall stops the service and tears down the rootless daemon + users in order, so the follow-up install behaves like a true first install. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- init.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/init.sh b/init.sh index 4fd7624..d6c1aff 100755 --- a/init.sh +++ b/init.sh @@ -1319,11 +1319,15 @@ runFullUninstall() isNotice "LEFT IN PLACE: the docker engine, docker-compose, apt-installed deps," isNotice "and your SSH config (so you can't get locked out)." echo "" - isQuestion "Type exactly DELETE LIBREPORTAL to confirm:" - local confirm; read -r confirm - if [[ "$confirm" != "DELETE LIBREPORTAL" ]]; then - isNotice "Aborted — nothing was removed." - return 0 + if [[ "$init_unattended_mode" == true ]]; then + isNotice "Unattended mode — proceeding without the DELETE LIBREPORTAL prompt." + else + isQuestion "Type exactly DELETE LIBREPORTAL to confirm:" + local confirm; read -r confirm + if [[ "$confirm" != "DELETE LIBREPORTAL" ]]; then + isNotice "Aborted — nothing was removed." + return 0 + fi fi isHeader "Tearing down LibrePortal"