From 75010fbff57a12a15c223d9ec880e03bde60ec8b Mon Sep 17 00:00:00 2001 From: buildplan Date: Fri, 4 Jul 2025 16:06:35 +0100 Subject: [PATCH] fixing tailscale config --- du_setup.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/du_setup.sh b/du_setup.sh index ea5f60b..8062f5c 100644 --- a/du_setup.sh +++ b/du_setup.sh @@ -2068,17 +2068,21 @@ generate_summary() { fi local TS_COMMAND="" if command -v tailscale >/dev/null 2>&1; then - if systemctl is-active --quiet tailscaled && tailscale ip >/dev/null 2>&1; then - 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." - echo "$TS_IPS" > /tmp/tailscale_ips.txt - else + if systemctl is-active --quiet tailscaled && tailscale ip >/dev/null 2>&1; then + 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." + echo "$TS_IPS" > /tmp/tailscale_ips.txt + else + if grep -q "Tailscale connection failed: tailscale up" "$LOG_FILE"; then 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"} + TS_COMMAND=${TS_COMMAND:-""} + else + print_info "Service tailscaled is installed but not configured." + TS_COMMAND="" fi fi if [[ "$AUDIT_RAN" == true ]]; then