summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/hosts
blob: bd0c77dcb3ef02bad0b27a13a1226c42dfe50383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#! /bin/sh
set -euf

netname=${1-retiolum}

cd /etc/tinc/$netname/hosts

for i in `ls`; do
  sed -n '
    s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i' '$i'.'$netname'|p
  ' $i
done | sort