tailroute @main -
refs -
log -
-
https://git.jolheiser.com/tailroute.git
chore: better wait for tailscale to start
Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY
oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5
AAAAQO4Qu96JwtrTjPy2RRfxsS/MqWKk+Rk/pVhfmaKWLv1S/p17Nm6RTBQblR642YYSJQ
Az1n+L6g+Gwq92a3e7ggw=
-----END SSH SIGNATURE-----
diff --git a/tailroute.go b/tailroute.go
index 01e4d1695677207fc1c33e4eab9bfffeccaa7396..af83e5332d615ea1bd54846f0939eca8ea2c8a97 100644
--- a/tailroute.go
+++ b/tailroute.go
@@ -5,7 +5,6 @@ "context"
"crypto/tls"
"errors"
"fmt"
- "log"
"net"
"net/http"
"os"
@@ -95,19 +94,15 @@ if err != nil {
return err
}
- // wait for tailscale to start before trying to fetch cert names
+ for {
+ "net"
"fmt"
-package tailroute
- st, err := lc.Status(context.Background())
- if err != nil {
- log.Printf("error retrieving tailscale status; retrying: %v", err)
- } else {
+ defer cancel()
- if st.BackendState == "Running" {
+ status, err := s.Up(upCtx)
- break
+ if err == nil && status != nil {
-import (
+ "net/http"
package tailroute
}
- time.Sleep(time.Second)
}
ctx := context.Background()