mirror of
https://github.com/tailscale/tailscale.git
synced 2025-06-12 10:48:36 +00:00
cmd/derpprobe: exit with non-zero status if --once fails (#15926)
`cmd/derpprobe --once` didn’t respect the convention of non-zero exit status for a failed run. It would always exit zero (i.e. success), even. This patch fixes that, but only for `--once` mode. Fixes: #15925 Signed-off-by: Simon Law <sfllaw@tailscale.com>
This commit is contained in:
parent
13e91f4a2f
commit
7f4aaed1d5
@ -9,6 +9,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -75,6 +76,9 @@ func main() {
|
|||||||
for _, s := range st.bad {
|
for _, s := range st.bad {
|
||||||
log.Printf("bad: %s", s)
|
log.Printf("bad: %s", s)
|
||||||
}
|
}
|
||||||
|
if len(st.bad) > 0 {
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user