From 712541d5d899d8064c26a67c910ab772232dcd21 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 29 Nov 2025 18:41:59 +0000 Subject: [PATCH] Fix indentation in cleanup section after pvesh refactor The previous commit left broken indentation and an orphaned else block in the cleanup section. This fixes the structure to properly handle the cluster nodes vs standalone node cases. Related to #738 --- scripts/install-sensor-proxy.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/scripts/install-sensor-proxy.sh b/scripts/install-sensor-proxy.sh index b8c8732..ce79736 100755 --- a/scripts/install-sensor-proxy.sh +++ b/scripts/install-sensor-proxy.sh @@ -2713,25 +2713,19 @@ if [[ -z "$HOST" ]]; then fi if [[ -n "$CLUSTER_NODES" ]]; then - for node_ip in $CLUSTER_NODES; do - log_info "Cleaning up SSH keys on node $node_ip" + for node_ip in $CLUSTER_NODES; do + log_info "Cleaning up SSH keys on node $node_ip" - # Remove both pulse-managed-key and pulse-proxy-key entries - ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=5 root@"$node_ip" \ - "sed -i -e '/# pulse-managed-key\$/d' -e '/# pulse-proxy-key\$/d' /root/.ssh/authorized_keys" 2>&1 | \ - logger -t "$LOG_TAG" -p user.info || \ - log_warn "Failed to clean up SSH keys on $node_ip" - done - log_info "Cluster cleanup completed" - else - # Standalone node - clean up localhost - log_info "Standalone node detected - cleaning up localhost" - sed -i -e '/# pulse-managed-key$/d' -e '/# pulse-proxy-key$/d' /root/.ssh/authorized_keys 2>&1 | \ + # Remove both pulse-managed-key and pulse-proxy-key entries + ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=5 root@"$node_ip" \ + "sed -i -e '/# pulse-managed-key\$/d' -e '/# pulse-proxy-key\$/d' /root/.ssh/authorized_keys" 2>&1 | \ logger -t "$LOG_TAG" -p user.info || \ - log_warn "Failed to clean up SSH keys on localhost" - fi + log_warn "Failed to clean up SSH keys on $node_ip" + done + log_info "Cluster cleanup completed" else - log_warn "pvecm command not available - cleaning up localhost only" + # Standalone node - clean up localhost + log_info "Standalone node detected - cleaning up localhost" sed -i -e '/# pulse-managed-key$/d' -e '/# pulse-proxy-key$/d' /root/.ssh/authorized_keys 2>&1 | \ logger -t "$LOG_TAG" -p user.info || \ log_warn "Failed to clean up SSH keys on localhost"