From 031c9946e8d3f44464291ab1345644a3500bf25b Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 26 May 2011 10:28:35 +0200 Subject: changed weight-calculation for graphgen --- hosts/.scripts/adv_graphgen/parse.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'hosts/.scripts') diff --git a/hosts/.scripts/adv_graphgen/parse.py b/hosts/.scripts/adv_graphgen/parse.py index 27fe3a99..b0534d93 100755 --- a/hosts/.scripts/adv_graphgen/parse.py +++ b/hosts/.scripts/adv_graphgen/parse.py @@ -35,7 +35,10 @@ def merge_edges(nodes): def write_node(k,v): - """ writes a single node and its edges """ + """ writes a single node and its edges + edges are weightet with the informations inside the nodes provided by + tinc + """ node = " "+k+"[label=\"" node += k+"\\l" node += "external:"+v['external-ip']+":"+v['external-port']+"\\l" @@ -47,11 +50,12 @@ def write_node(k,v): node += "]" print (node) for con in v.get('to',[]): - edge = " "+k+ " -> " +con['name'] + "[weight="+str(10/float(con['weight'])) + edge = " "+k+ " -> " +con['name'] + "[weight="+str(float(con['weight'])) if con.get('bidirectional',False): edge += ",dir=both" edge += "]" print edge + def parse_input(): nodes={} for line in sys.stdin: -- cgit v1.2.3 From 508bcf9c67cdc6bb42a0bef4655c2c1a27d497be Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 26 May 2011 13:06:12 +0200 Subject: fixed missing +x in startup script --- hosts/.scripts/autostart/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hosts/.scripts') diff --git a/hosts/.scripts/autostart/Makefile b/hosts/.scripts/autostart/Makefile index 58bfc0c5..7ca589e1 100644 --- a/hosts/.scripts/autostart/Makefile +++ b/hosts/.scripts/autostart/Makefile @@ -1,7 +1,8 @@ -INIT_FOLDER=/etc/rc.d +INIT_FOLDER=/etc/init.d .phony: all all: #TODO change the tinc file before writing cp tinc $(INIT_FOLDER)/tinc + chmod +x $(INIT_FOLDER)/tinc echo "retiolum" > /etc/tinc/nets.boot update-rc.d tinc defaults -- cgit v1.2.3 From b3b1187e2d1cb615405851174f044882346a6815 Mon Sep 17 00:00:00 2001 From: Felix Richter Date: Thu, 26 May 2011 13:59:47 +0200 Subject: fixed borken parse script wrong behaviour when we do not know the internal ip of a node for some reason. fixed autostart script to modprobe tun before continuning --- hosts/.scripts/adv_graphgen/parse.py | 4 +++- hosts/.scripts/autostart/tinc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 hosts/.scripts/autostart/tinc (limited to 'hosts/.scripts') diff --git a/hosts/.scripts/adv_graphgen/parse.py b/hosts/.scripts/adv_graphgen/parse.py index b0534d93..04b42c33 100755 --- a/hosts/.scripts/adv_graphgen/parse.py +++ b/hosts/.scripts/adv_graphgen/parse.py @@ -1,4 +1,5 @@ #!/usr/bin/python2 +# -*- coding: utf8 -*- import sys """ TODO: Refactoring needed to pull the edges out of the node structures again, @@ -44,7 +45,8 @@ def write_node(k,v): node += "external:"+v['external-ip']+":"+v['external-port']+"\\l" if v.has_key('num_conns'): node += "Num Connects:"+str(v['num_conns'])+"\\l" - node += "internal:"+v['internal-ip']+"\\l\"" + + node += "internal:"+v.get('internal-ip','¯\\\\(°_o)/¯')+"\\l\"" if v['external-ip'] == "MYSELF": node += ",fillcolor=steelblue1" node += "]" diff --git a/hosts/.scripts/autostart/tinc b/hosts/.scripts/autostart/tinc old mode 100644 new mode 100755 index 06d10403..12e77d6a --- a/hosts/.scripts/autostart/tinc +++ b/hosts/.scripts/autostart/tinc @@ -25,6 +25,8 @@ TCONF="/etc/tinc" NETSFILE="$TCONF/nets.boot" NETS="" +modprobe tun + test -f $DAEMON || exit 0 [ -r /etc/default/tinc ] && . /etc/default/tinc -- cgit v1.2.3