summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/hosts
blob: 44dbd88ddb075391bb5a34f6ec5f754904af1f44 (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 -En '
    s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1	'$i'.'$netname' '$i'|p
  ' $i
done | sort