summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen/sanitize.sh
diff options
context:
space:
mode:
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