From c1ad4283b090125c4b577ab4788f289c9e57a2bf Mon Sep 17 00:00:00 2001 From: Fimeg Date: Sun, 2 Nov 2025 13:32:53 -0500 Subject: [PATCH] fix: clean old config on agent reinstall install script now removes old .env and config.json prevents conflicts during reinstall/upgrade addresses .env conflict errors reported in testing --- aggregator-agent/install.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aggregator-agent/install.sh b/aggregator-agent/install.sh index a52a053..59b479f 100755 --- a/aggregator-agent/install.sh +++ b/aggregator-agent/install.sh @@ -174,6 +174,18 @@ register_agent() { # Create config directory mkdir -p /etc/aggregator + # Clean up old configuration files (prevents conflicts during reinstall/upgrade) + if [ -f /etc/aggregator/.env ]; then + echo "Removing old .env file..." + rm -f /etc/aggregator/.env + echo "✓ Old .env file removed" + fi + if [ -f /etc/aggregator/config.json ]; then + echo "Removing old config.json file..." + rm -f /etc/aggregator/config.json + echo "✓ Old config.json file removed" + fi + # Set SELinux context for config directory if SELinux is enabled if command -v getenforce >/dev/null 2>&1 && [ "$(getenforce)" != "Disabled" ]; then echo "Setting SELinux context for config directory..."