summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen/sanitize.sh
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2011-11-10 18:15:34 +0100
committerEUcancER <root@euer.krebsco.de>2011-11-10 18:15:34 +0100
commit35be61fece8fabb430ef44c3f7a7d62d62b18ffd (patch)
tree58aa9ab4999e40f945ac7ca6b8aa446f569ac428 /retiolum/scripts/adv_graphgen/sanitize.sh
parenta78c067d47f295ed91242cb9a30ba9c7b4e6b572 (diff)
//retiolum/adv_graphgen: refactor graph generation, fix weight issue
Diffstat (limited to 'retiolum/scripts/adv_graphgen/sanitize.sh')
-rwxr-xr-xretiolum/scripts/adv_graphgen/sanitize.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/retiolum/scripts/adv_graphgen/sanitize.sh b/retiolum/scripts/adv_graphgen/sanitize.sh
index 402ce256..5572b9d9 100755
--- a/retiolum/scripts/adv_graphgen/sanitize.sh
+++ b/retiolum/scripts/adv_graphgen/sanitize.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+set -xeuf
cd $(dirname `readlink -f $0`)
GRAPH_SETTER1=dot
GRAPH_SETTER2=circo
@@ -9,16 +10,21 @@ TYPE=svg
TYPE2=png
OPENER=/bin/true
DOTFILE=`mktemp`
-trap 'rm $DOTFILE' SIGTERM
+trap 'rm $DOTFILE' INT TERM
sudo LOG_FILE=$LOG_FILE python tinc_stats.py |\
python parse_tinc_stats.py > $DOTFILE
-$GRAPH_SETTER1 -T$TYPE -o $1/retiolum_1.$TYPE $DOTFILE
-$GRAPH_SETTER2 -T$TYPE -o $1/retiolum_2.$TYPE $DOTFILE
-$GRAPH_SETTER3 -T$TYPE -o $1/retiolum_3.$TYPE $DOTFILE
-$GRAPH_SETTER4 -T$TYPE -o $1/retiolum_4.$TYPE $DOTFILE
+
+i=1
+for setter in dot circo 'neato -Goverlap=prism ' sfdp
+do
+ tmpgraph=`mktemp --tmpdir=$1`
+ $setter -T$TYPE -o $tmpgraph $DOTFILE
+ chmod go+rx $tmpgraph
+ mv $tmpgraph $1retiolum_$i.$TYPE
+ i=`expr $i + 1`
+done
#convert -resize 20% $1/retiolum_1.$TYPE $1/retiolum_1.$TYPE2
#convert -resize 20% $1/retiolum_2.$TYPE $1/retiolum_2.$TYPE2
#convert -resize 20% $1/retiolum_3.$TYPE $1/retiolum_3.$TYPE2
#convert -resize 20% $1/retiolum_4.$TYPE $1/retiolum_4.$TYPE2
-#$OPENER $1/retiolum_1.$TYPE &>/dev/null