From 9b248e279c32b9cd0e92dd507b43032c7fc58895 Mon Sep 17 00:00:00 2001 From: buildplan Date: Mon, 30 Jun 2025 13:26:43 +0100 Subject: [PATCH] little things --- du_setup.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/du_setup.sh b/du_setup.sh index 33274e7..5137511 100644 --- a/du_setup.sh +++ b/du_setup.sh @@ -1102,8 +1102,8 @@ install_tailscale() { if $CONNECTED; then print_success "Tailscale reconfigured with additional options. Node IPv4 in tailnet: $TS_IPV4" log "Tailscale reconfigured: $TS_COMMAND" - # Store flags and IPs for summary - echo "${TS_FLAGS// --/}" > /tmp/tailscale_flags + # Store flags and IPs for summary + echo "$TS_FLAGS" | sed 's/ --/ /g' | sed 's/^ *//' > /tmp/tailscale_flags echo "$TS_IPS" > /tmp/tailscale_ips.txt else print_warning "Tailscale reconfiguration attempt succeeded, but no IPs assigned." @@ -1659,6 +1659,7 @@ configure_security_audit() { log "Lynis installation failed." else print_info "Running Lynis audit (non-interactive mode, this will take a few minutes)..." + print_warning "Review audit results in $AUDIT_LOG for security recommendations." if lynis audit system --quick >> "$AUDIT_LOG" 2>&1; then print_success "Lynis audit completed. Check $AUDIT_LOG for details." log "Lynis audit completed successfully." @@ -1751,10 +1752,10 @@ generate_summary() { local TS_IPS TS_IPV4 TS_IPS=$(tailscale ip 2>/dev/null || echo "Unknown") TS_IPV4=$(echo "$TS_IPS" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | head -1 || echo "Unknown") - print_success "Service tailscaled is active and connected. Node IPv4 in tailnet: $TS_IPV4" + print_success "Service tailscaled is active and connected." echo "$TS_IPS" > /tmp/tailscale_ips.txt else - print_error "Service tailscaled is NOT active or not connected." + print_error "Service tailscaled is NOT active" FAILED_SERVICES+=("tailscaled") TS_COMMAND=$(grep "Tailscale connection failed: tailscale up" "$LOG_FILE" | tail -1 | sed 's/.*Tailscale connection failed: //') TS_COMMAND=${TS_COMMAND:-"tailscale up --operator=$USERNAME"} @@ -1801,7 +1802,9 @@ generate_summary() { fi if command -v tailscale >/dev/null 2>&1; then local TS_SERVER=$(cat /tmp/tailscale_server 2>/dev/null || echo "https://controlplane.tailscale.com") - local TS_IPS=$(cat /tmp/tailscale_ips.txt 2>/dev/null || echo "Not connected") + local TS_IPS_RAW=$(cat /tmp/tailscale_ips.txt 2>/dev/null || echo "Not connected") + # --- FIX: Format IPs to be on a single line --- + local TS_IPS=$(echo "$TS_IPS_RAW" | paste -sd ", " -) local TS_FLAGS=$(cat /tmp/tailscale_flags 2>/dev/null || echo "None") echo -e " Tailscale: ${GREEN}Enabled${NC}" printf " %-16s%s\n" "- Server:" "$TS_SERVER" @@ -1837,7 +1840,7 @@ generate_summary() { fi if [[ -f /root/run_backup.sh ]]; then echo -e " Remote Backup:" - printf " %-18s${CYAN}%s${NC}\n" "- Verify SSH key:" "cat /root/.ssh/id_ed25519.pub" + printf " %-18s${CYAN}%s${NC}\n" "- Verify SSH key:" "sudo cat /root/.ssh/id_ed25519.pub" printf " %-18s${CYAN}%s${NC}\n" "- Copy key if needed:" "ssh-copy-id -p $BACKUP_PORT -s $BACKUP_DEST" printf " %-18s${CYAN}%s${NC}\n" "- Test backup:" "sudo /root/run_backup.sh" printf " %-18s${CYAN}%s${NC}\n" "- Check logs:" "sudo less $BACKUP_LOG"