mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #3804 from holta/iiab-vpn_status3
Tighten & brighten iiab-vpn status table output
This commit is contained in:
commit
4dd927cfd0
1 changed files with 6 additions and 4 deletions
|
@ -60,9 +60,11 @@ echo -e " tailscale logout\n"
|
||||||
# More useful table of IPs/usernames/etc than 'tailscale status'
|
# More useful table of IPs/usernames/etc than 'tailscale status'
|
||||||
#echo -e "\e[44;1mVPN peers: (rightmost column = online/offline)\e[0m\n"
|
#echo -e "\e[44;1mVPN peers: (rightmost column = online/offline)\e[0m\n"
|
||||||
#tailscale status --json | jq -r '.Self,.Peer[] | .Tags[] + " " + .TailscaleIPs[] + " " + .HostName + " " + .DNSName + " " + .OS + " " + .Relay + " " + (.Online|tostring)' | sort -V | column -t
|
#tailscale status --json | jq -r '.Self,.Peer[] | .Tags[] + " " + .TailscaleIPs[] + " " + .HostName + " " + .DNSName + " " + .OS + " " + .Relay + " " + (.Online|tostring)' | sort -V | column -t
|
||||||
echo -e '\e[44;1mVPN peers: ("true" in 6th column means online)\e[0m\n'
|
#echo -e '\e[44;1mVPN peers: ("true" in 6th column means online)\e[0m\n'
|
||||||
tailscale status --json | jq -r '.Self,.Peer[] | .Tags[] + " " + .TailscaleIPs[] + " " + .HostName + " " + .DNSName + " " + .Relay + " " + (.Online|tostring) + " " + .OS' | sort -V | column -t | \
|
echo -e '\e[44;1mVPN peers: (6th column = online/offline)\e[0m\n'
|
||||||
while read line; do
|
tailscale status --json | jq -r '.Self,.Peer[] | .Tags[] + " " + .TailscaleIPs[] + " " + .HostName + " " + .DNSName + " " + .Relay + " XXX" + (.Online|tostring) + "XXX " + .OS' | sort -V | column -t | \
|
||||||
echo "$line" $(tailscale whois --json $(echo $line | cut -d' ' -f2) | jq -r '.Node.Hostinfo | .Distro + " " + .DistroVersion + " " + .DeviceModel');
|
while read l; do
|
||||||
|
line=$(echo "$l" | sed 's/ XXXtrueXXX /\\e[0;32m ✅\\e[0m/ ; s/ XXXfalseXXX /\\e[0;31m ❌ \\e[0m/')
|
||||||
|
echo -e "$line" $(tailscale whois --json $(echo $line | cut -d' ' -f2) | jq -r '.Node.Hostinfo | .Distro + " " + .DistroVersion + " " + .DeviceModel');
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue