https://github.com/josh/wait4tailscale
Monitor Tailscale connection status
https://github.com/josh/wait4tailscale
systemd tailscale
Last synced: about 1 month ago
JSON representation
Monitor Tailscale connection status
- Host: GitHub
- URL: https://github.com/josh/wait4tailscale
- Owner: josh
- License: mit
- Archived: true
- Created: 2025-08-29T22:25:33.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2026-03-19T02:39:27.000Z (4 months ago)
- Last Synced: 2026-03-19T16:42:44.470Z (4 months ago)
- Topics: systemd, tailscale
- Language: Go
- Homepage:
- Size: 74.2 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# wait4tailscale
> **Deprecated:** This project's functionality has been upstreamed into Tailscale itself. Since Tailscale v1.82, you can use the built-in [`tailscale wait`](https://github.com/tailscale/tailscale/pull/18574) command and [`tailscale-online.target`](https://github.com/tailscale/tailscale/pull/18577) systemd target instead.
>
> ```
> $ tailscale wait && /path/to/your/service
> ```
>
> For systemd services:
>
> ```ini
> [Unit]
> After=tailscale-online.target
> Requires=tailscale-online.target
> ```
>
> The `tailscale wait` command also supports a `--timeout` flag and there is a new `tailscale ip --assert=` option for verifying a specific IP assignment.
---
Basically a rich man's version of this poor man's bash script:
```bash
while ! tailscale status --json | jq --exit-status '.Self.Online' >/dev/null
sleep 1
done
```
## Usage
Block until tailscale reaches an online or offline state. Returns immediately if its already in its desired state.
```
$ wait4tailscale --online
$ wait4tailscale --offline
```
Or watch a log of all changes
```
$ wait4tailscale --watch
online
offline
online
```
Will automatically detect the default socket location, but otherwise a socket can be explicitly given.
```
$ wait4tailscale --socket /var/run/tailscale/tailscaled.sock
```
### systemd Integration
The package includes systemd units that provide a `tailscale-online.target` similar to `network-online.target`. Other services can depend on this target to wait for Tailscale connectivity:
```ini
[Unit]
After=tailscale-online.target
Wants=tailscale-online.target
```
### Nix
Packaged under [josh/nurpkgs](https://github.com/josh/nurpkgs) flake. Use the systemd units in your NixOS config with something like this:
```nix
systemd.packages = [ pkgs.nur.repos.josh.wait4tailscale ];
```