summaryrefslogtreecommitdiffstats
path: root/retiolum/hosts/.scripts
diff options
context:
space:
mode:
Diffstat (limited to 'retiolum/hosts/.scripts')
-rwxr-xr-xretiolum/hosts/.scripts/adv_graphgen/parse.py12
-rw-r--r--retiolum/hosts/.scripts/autostart/Makefile3
-rwxr-xr-x[-rw-r--r--]retiolum/hosts/.scripts/autostart/tinc2
3 files changed, 13 insertions, 4 deletions
diff --git a/retiolum/hosts/.scripts/adv_graphgen/parse.py b/retiolum/hosts/.scripts/adv_graphgen/parse.py
index 27fe3a99..04b42c33 100755
--- a/retiolum/hosts/.scripts/adv_graphgen/parse.py
+++ b/retiolum/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,
@@ -35,23 +36,28 @@ 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"
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 += "]"
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:
diff --git a/retiolum/hosts/.scripts/autostart/Makefile b/retiolum/hosts/.scripts/autostart/Makefile
index 58bfc0c5..7ca589e1 100644
--- a/retiolum/hosts/.scripts/autostart/Makefile
+++ b/retiolum/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
diff --git a/retiolum/hosts/.scripts/autostart/tinc b/retiolum/hosts/.scripts/autostart/tinc
index 06d10403..12e77d6a 100644..100755
--- a/retiolum/hosts/.scripts/autostart/tinc
+++ b/retiolum/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