willpower232

willpower232 / tailscaleToHostCtl.sh

Last active 1 month ago

Like 0

Revision 0ee613de5736a6ba24cc63f9b5eb77633d89ba2f

tailscaleToHostCtl.sh Raw
1#!/bin/bash
2
3tailscale status | while IFS= read -r aHost; do
4 hostname=$(echo "$aHost" | awk '{print $2}' | cut -d '-' -f 1)
5 ip=$(echo "$aHost" | awk '{print $1}')
6
7 hostctl add domains tailscale "$hostname.ts" --ip "$ip"
8done