From 60951b45fd11908f0b81f5ceb904af5f64604fd2 Mon Sep 17 00:00:00 2001 From: Vishnu Narayanan Date: Tue, 22 Jul 2025 15:08:51 +0530 Subject: [PATCH] fix: cwctl web/worker conversion (#12006) --- VERSION_CWCTL | 2 +- deployment/setup_20.04.sh | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/VERSION_CWCTL b/VERSION_CWCTL index 15a279981..18091983f 100644 --- a/VERSION_CWCTL +++ b/VERSION_CWCTL @@ -1 +1 @@ -3.3.0 +3.4.0 diff --git a/deployment/setup_20.04.sh b/deployment/setup_20.04.sh index d1091da3c..e904441a9 100644 --- a/deployment/setup_20.04.sh +++ b/deployment/setup_20.04.sh @@ -2,7 +2,7 @@ # Description: Install and manage a Chatwoot installation. # OS: Ubuntu 20.04 LTS, 22.04 LTS, 24.04 LTS -# Script Version: 3.2.0 +# Script Version: 3.4.0 # Run this script as root set -eu -o errexit -o pipefail -o noclobber -o nounset @@ -439,7 +439,14 @@ function configure_systemd_services() { systemctl stop chatwoot-worker.1.service || true systemctl disable chatwoot-worker.1.service || true fi - + + # Stop and disable worker target if converting from worker-only + if [ -f "/etc/systemd/system/chatwoot-worker.target" ]; then + echo "Converting from worker-only to web-only" + systemctl stop chatwoot-worker.target || true + systemctl disable chatwoot-worker.target || true + fi + cp /home/chatwoot/chatwoot/deployment/chatwoot-web.1.service /etc/systemd/system/chatwoot-web.1.service cp /home/chatwoot/chatwoot/deployment/chatwoot-web.target /etc/systemd/system/chatwoot-web.target @@ -458,7 +465,14 @@ function configure_systemd_services() { systemctl stop chatwoot-web.1.service || true systemctl disable chatwoot-web.1.service || true fi - + + # Stop and disable web target if converting from web-only + if [ -f "/etc/systemd/system/chatwoot-web.target" ]; then + echo "Converting from web-only to worker-only" + systemctl stop chatwoot-web.target || true + systemctl disable chatwoot-web.target || true + fi + cp /home/chatwoot/chatwoot/deployment/chatwoot-worker.1.service /etc/systemd/system/chatwoot-worker.1.service cp /home/chatwoot/chatwoot/deployment/chatwoot-worker.target /etc/systemd/system/chatwoot-worker.target