summaryrefslogtreecommitdiffstats
path: root/ship/src
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-02-26 23:19:20 +0100
committermakefu <root@pigstarter.de>2014-02-26 23:19:20 +0100
commitf3ea7bd0a99103ebd79aa0b53515995d4d333386 (patch)
tree87d2546f298fe59fad36ca9ff56e56c54f1557dd /ship/src
parentd2bd337c5d965b85cae5b5c14dd82f914bdbbe62 (diff)
parent9ac3dfec03ffe45bd5a91bb05f233482d078556c (diff)
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'ship/src')
-rw-r--r--ship/src/refresh-super-keys5
-rw-r--r--ship/src/refresh-supers9
2 files changed, 13 insertions, 1 deletions
diff --git a/ship/src/refresh-super-keys b/ship/src/refresh-super-keys
new file mode 100644
index 00000000..dddbe846
--- /dev/null
+++ b/ship/src/refresh-super-keys
@@ -0,0 +1,5 @@
+#!/bin/sh
+#@info
+#@include retiolum
+#@mainifyme
+refresh_supernode_keys
diff --git a/ship/src/refresh-supers b/ship/src/refresh-supers
index 26909a94..af31a5df 100644
--- a/ship/src/refresh-supers
+++ b/ship/src/refresh-supers
@@ -1,6 +1,9 @@
#!/bin/sh
#@info
# usage: [DEBUG=1] [tincconf=/not/tinc/retiolum/tinc.conf] $0
+# This is the implementation of the proposal how to update tinc supernode
+# connections
+
#@include core
#@include retiolum
# using find_supernodes
@@ -10,12 +13,14 @@
#@strict
#@mainifyme
+refresh_supernode_keys
+
max_connect_to=${max_connect_to:-5}
tincconf=${tincconf:-$tinc_path/$netname/tinc.conf}
tmp_tincconf=$(mktemp)
defer "rm -f $tmp_tincconf"
-sed '/[ ]*ConnectTo=/d' "$tincconf" > "$tmp_tincconf"
+sed '/^[ ]*ConnectTo/d' "$tincconf" > "$tmp_tincconf"
find_supernodes | cut -d\ -f 1 | shuf \
| head -n "${max_connect_to}" \
@@ -24,3 +29,5 @@ find_supernodes | cut -d\ -f 1 | shuf \
info "replacing old tinc.conf with one"
test "${DEBUG:-}" && diff "$tincconf" "$tmp_tincconf"
mv "$tmp_tincconf" "$tincconf"
+
+tinc_reload