summaryrefslogtreecommitdiffstats
path: root/retiolum/bin
diff options
context:
space:
mode:
authorroot <root@gum.krebsco.de>2015-03-20 09:08:49 +0100
committerroot <root@gum.krebsco.de>2015-03-20 09:08:49 +0100
commit6a291f4c34122e49e60fb7110394df8832893fbb (patch)
tree779d57b37d7bacf3314b7a2cd75de45c0daf14a5 /retiolum/bin
parent31cd6dc60bf8b8380f899e3655e06841836b4067 (diff)
retiolum/bin/hosts: allow "Aliases = ..." in tinc hosts files
Diffstat (limited to 'retiolum/bin')
-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
-