Skip to content

Commit 2e4e921

Browse files
committed
Add script to refresh Tailscale certificates and export to PKCS12 format
1 parent 51300b2 commit 2e4e921

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

refresh-cert.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
cd /home/piuser/cert
4+
5+
DEVICE_NAME=$(tailscale status --self=true --peers=false | awk '{print $2}')
6+
echo "Device Name: $DEVICE_NAME"
7+
8+
CERT_NAME=$DEVICE_NAME".boston-cloud.ts.net"
9+
echo "Certificate Name: $CERT_NAME"
10+
11+
sudo tailscale cert --min-validity 720h $CERT_NAME
12+
sudo openssl pkcs12 -export -out certificate.pfx -inkey $CERT_NAME".key" -in $CERT_NAME".crt" -passout pass:

0 commit comments

Comments
 (0)