summaryrefslogtreecommitdiffstats
path: root/retiolum/bin/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'retiolum/bin/hosts')
-rwxr-xr-xretiolum/bin/hosts7
1 files changed, 5 insertions, 2 deletions
diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts
index 44dbd88d..3a8dbcc9 100755
--- a/retiolum/bin/hosts
+++ b/retiolum/bin/hosts
@@ -6,8 +6,11 @@ netname=${1-retiolum}
cd /etc/tinc/$netname/hosts
for i in `ls`; do
+ hname="$i $i.retiolum"
+ for j in `sed -En 's|^ *Aliases *= *(.+)|\1|p' $i`;do
+ hname="${hname} $j.retiolum $j"
+ done
sed -En '
- s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1 '$i'.'$netname' '$i'|p
+ s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1 '"$hname"'|p
' $i
done | sort
-