fix: use JSON status of tailscale to determin up state

Fixes: #4 (closed)

Using tailscale status --json some extended information about the Tailscale client can be fetched. Additionally, although the JSON data is subject to change, it is likely more stable than parsing tailscale status.

However, employing this solution create a dependency on the CLI util jq (Command-line JSON processor). Another option would be to employ grep to fetch the "Online" field like this:

tailscale status --json | grep --quiet '"Online"\s*:\s*true,'

It still creates a dependency on grep. However, this is a default tool most likely installed.

Edited by Daniel

Merge request reports

Loading