-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathtailscale.sh
More file actions
48 lines (41 loc) · 946 Bytes
/
tailscale.sh
File metadata and controls
48 lines (41 loc) · 946 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Tailscale information
echo "🐉 Tailscale Information"
echo "========================="
echo ""
# Check if Tailscale is installed
if ! command -v tailscale &> /dev/null; then
echo "Tailscale is not installed"
exit 0
fi
# Status
echo "Status:"
echo "-------"
tailscale status 2>/dev/null || echo " Not connected or not running"
echo ""
# Tailscale IP
echo "Tailscale IPs:"
echo "--------------"
tailscale ip 2>/dev/null | while read ip; do
echo " - $ip"
done
echo ""
# Peers
echo "Connected Peers:"
echo "----------------"
tailscale status 2>/dev/null | grep -E "^#|^.*:.*\." | head -20
echo ""
# Exit Node
echo "Exit Node:"
echo "----------"
EXIT_NODE=$(tailscale status 2>/dev/null | grep -o "exit node .*" | cut -d':' -f2 | xargs)
if [ -n "$EXIT_NODE" ]; then
echo " $EXIT_NODE"
else
echo " No exit node configured"
fi
echo ""
# Version
echo "Version:"
echo "--------"
tailscale version 2>/dev/null | head -1