feat(scripts): add script for Tailscale Lock signing of Mullvad nodes

This commit is contained in:
Felix Schröter 2025-02-14 00:14:23 +01:00
parent 3976e392e1
commit e964443c5d
Signed by: felschr
GPG key ID: 671E39E6744C807D

View file

@ -0,0 +1,26 @@
#! /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
print $"unsigned nodes: ($count_total) total, ($count_mullvad) Mullvad"
if ($nodes_mullvad | length) == 0 {
print "no Mullvad nodes need to be signed"
return
}
print "signing Mullvad nodes..."
$nodes_mullvad | each { |node|
print $"signing ($node.Name)"
tailscale lock sign $node.NodeKey
sleep 0.1sec
}
print "all Mullvad nodes successfully signed"