Skip to content

Instantly share code, notes, and snippets.

@felschr
Last active May 17, 2024 01:54
Show Gist options
  • Save felschr/fb18163924bbe748a6226b891ef44427 to your computer and use it in GitHub Desktop.
Save felschr/fb18163924bbe748a6226b891ef44427 to your computer and use it in GitHub Desktop.
Tailnet Lock: Sign Mullvad exit nodes
#! /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