From de536b5eae60670a2bf2744a87ed2c66b9d87010 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sun, 24 Aug 2025 08:56:56 +0000 Subject: [PATCH] improve: make uninstall process more thorough The remove option now: - Removes symlink at /usr/local/bin/pulse - Asks before removing config/data in /etc/pulse - Asks before removing the pulse user account - Cleans up log files - Removes all possible service file variations - Runs systemctl daemon-reload after service removal --- install.sh | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e0efc0623..4a4eee66c 100755 --- a/install.sh +++ b/install.sh @@ -1029,10 +1029,48 @@ main() { print_completion ;; remove) - systemctl stop $SERVICE_NAME || true - systemctl disable $SERVICE_NAME || true + # Stop and disable service + systemctl stop $SERVICE_NAME 2>/dev/null || true + systemctl disable $SERVICE_NAME 2>/dev/null || true + + # Remove service files rm -f /etc/systemd/system/$SERVICE_NAME.service + rm -f /etc/systemd/system/pulse.service + rm -f /etc/systemd/system/pulse-backend.service + systemctl daemon-reload + + # Remove installation directory rm -rf "$INSTALL_DIR" + + # Remove symlink + rm -f /usr/local/bin/pulse + + # Ask about config/data removal + echo + print_info "Config and data files exist in $CONFIG_DIR" + safe_read "Remove all configuration and data? (y/N): " remove_config + if [[ "$remove_config" =~ ^[Yy]$ ]]; then + rm -rf "$CONFIG_DIR" + print_success "Configuration and data removed" + else + print_info "Configuration preserved in $CONFIG_DIR" + fi + + # Ask about user removal + if id "pulse" &>/dev/null; then + safe_read "Remove pulse user account? (y/N): " remove_user + if [[ "$remove_user" =~ ^[Yy]$ ]]; then + userdel pulse 2>/dev/null || true + print_success "User account removed" + else + print_info "User account preserved" + fi + fi + + # Remove any log files + rm -f /var/log/pulse*.log 2>/dev/null || true + rm -f /opt/pulse.log 2>/dev/null || true + print_success "Pulse removed successfully" ;; cancel)