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
This commit is contained in:
@@ -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..."
|
||||
|
||||
Reference in New Issue
Block a user