summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@also>2011-05-27 16:29:08 +0200
committertv <tv@also>2011-05-27 16:29:08 +0200
commit113296e7ec498bfc71288b861b531405373cbf65 (patch)
tree25a6d4f5a83a04d8090209f3feab20d119e75548
parentfa752fe606ec2d91ca69db0c0f7eb6de7fae4860 (diff)
retiolum/bin/hosts: initial commit
-rwxr-xr-xmodules/retiolum/bin/hosts11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/retiolum/bin/hosts b/modules/retiolum/bin/hosts
new file mode 100755
index 00000000..b5b29430
--- /dev/null
+++ b/modules/retiolum/bin/hosts
@@ -0,0 +1,11 @@
+#! /bin/sh
+set -euf
+
+netname=${1-retiolum}
+
+cd /etc/tinc/$netname/hosts
+
+for i in `ls`; do
+ sed -rn 's|^ *Subnet *= *([^ ]*) *$|\1\t'$i' '$i'.'$netname'|p' $i
+done
+