summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/adv_graphgen
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2011-10-26 12:36:45 +0200
committerEUcancER <root@euer.krebsco.de>2011-10-26 12:36:45 +0200
commitf6219c0bb717533b74c8362dac96636fff866e79 (patch)
tree2d3b8b7756c6cea1c5d6c2bd5ab27a79cbd73331 /retiolum/scripts/adv_graphgen
parentb1fc61c5a6f819a7e6840f73eb57ca33c5af461c (diff)
//retiolum/adv_graphgen: fix generator script
svg is now generated instead of png dotfile is now a tempfile
Diffstat (limited to 'retiolum/scripts/adv_graphgen')
-rwxr-xr-xretiolum/scripts/adv_graphgen/sanitize.sh23
1 files changed, 14 insertions, 9 deletions
diff --git a/retiolum/scripts/adv_graphgen/sanitize.sh b/retiolum/scripts/adv_graphgen/sanitize.sh
index 1dc43bf4..3fddb605 100755
--- a/retiolum/scripts/adv_graphgen/sanitize.sh
+++ b/retiolum/scripts/adv_graphgen/sanitize.sh
@@ -1,20 +1,25 @@
#!/bin/sh
HERE=$(dirname `readlink -f $0`)
-TMP=/tmp
GRAPH_SETTER1=dot
GRAPH_SETTER2=circo
GRAPH_SETTER3='neato -Goverlap=prism '
GRAPH_SETTER4=sfdp
LOG_FILE=/var/log/syslog
+TYPE=svg
+TYPE2=png
OPENER=/bin/true
-
+DOTFILE=`mktemp`
+trap 'rm $DOTFILE' SIGINT SIGTERM
sudo pkill -USR2 tincd
sudo sed -n '/tinc.retiolum/{s/.*tinc.retiolum\[[0-9]*\]: //gp}' $LOG_FILE |\
- $HERE/parse.py > $TMP/retiolum.dot
+ $HERE/parse.py > $DOTFILE
-$GRAPH_SETTER1 -Tpng -o $1/retiolum_1.png $TMP/retiolum.dot
-$GRAPH_SETTER2 -Tpng -o $1/retiolum_2.png $TMP/retiolum.dot
-$GRAPH_SETTER3 -Tpng -o $1/retiolum_3.png $TMP/retiolum.dot
-$GRAPH_SETTER4 -Tpng -o $1/retiolum_4.png $TMP/retiolum.dot
-$OPENER $HERE/retiolum_1.png &>/dev/null
-rm $TMP/retiolum.dot
+$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
+#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