summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/hosts
blob: 4426a811def437da0f04be99ee0b1bbdf02b3c0c (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\t'$i'.'$netname' '$i'|p
  ' $i
done | sort