From d818d26256380d1be91cb3d449271da96adb2105 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Feb 2014 22:53:35 +0100 Subject: implement IRC proposal to refresh supernodes //ship/src/refresh-supers is the script which will update your tinc config and choose 5 working supernodes for you to connect to. This proposal may become part of the tinc.krebsco.de install script --- ship/lib/retiolum | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'ship/lib/retiolum') diff --git a/ship/lib/retiolum b/ship/lib/retiolum index 3956a200..1e55041c 100644 --- a/ship/lib/retiolum +++ b/ship/lib/retiolum @@ -1,10 +1,28 @@ #!/bin/sh # retiolum host functions #@include core +#@include network tinc_path=${tinc_path:-/etc/tinc} netname=${netname:-retiolum} hosts_dir=${hosts_dir:-$tinc_path/$netname/hosts} +supernode_urls="http://euer.krebsco.de/retiolum/supernodes.tar.gz" +reload_tinc(){ + info "reloading tinc configuration" + pkill -HUP tincd || tinc -n $netname reload; +} +refresh_supernode_keys(){ + for url in $supernode_urls;do + info "Trying $url to retrieve supernodes" + if http_get "$url" \ + | tar xvz -C $hosts_dir | xargs -n1 echo "refreshed:" ;then + info "refreshed supernode keys" + return 0 + else + error "$url unusable for retrieving supernode host files" + fi + done && return 1 +} find_supernodes(){ cd $hosts_dir @@ -67,7 +85,7 @@ check_free_v4(){ info "Check if ip is still free: " for i in `ls -1`; do if grep -q -e $myipv4\$ $i ;then - warn "Host IP already taken by $i! " + error "Host IP already taken by $i! " return 1 fi done -- cgit v1.2.3