Last active
May 17, 2024 01:54
-
-
Save felschr/fb18163924bbe748a6226b891ef44427 to your computer and use it in GitHub Desktop.
Tailnet Lock: Sign Mullvad exit nodes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nu | |
let $status = tailscale lock status --json | from json | |
let $nodes = $status | get FilteredPeers | |
let $nodes_mullvad = $nodes | where Name =~ ".mullvad.ts.net" | |
let count_total = $nodes | length | |
let count_mullvad = $nodes_mullvad | length | |
echo $"unsigned nodes: ($count_total) total, ($count_mullvad) Mullvad" | |
if ($nodes_mullvad | length) == 0 { | |
echo "no Mullvad nodes need to be signed" | |
return | |
} | |
echo "signing Mullvad nodes..." | |
$nodes_mullvad | each { |node| | |
echo $"signing ($node.Name)" | |
tailscale lock sign $node.NodeKey | |
sleep 0.1sec | |
} | |
echo "all Mullvad nodes successfully signed" | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment