#!/usr/local/bin/perl # # vim:set ts=4 sw=4: use strict; use warnings; my %server; my %map; open(F,"){ chomp; if ($_ eq ""){ $from=undef; next; }; next if (/\[/); if(/^(.*)::$/){ $from=$1; next; }; if(/^([AC*]+):(.*)/){ $map{$from}{$2}=$1; next; }; warn "unparsed: $_\n"; }; close(F); my ($f,$t); print "digraph map {\n"; print qq!node [fontname="luximr" fontsize=9]\n!; #print qq!concentrate=true;!; for my $from (keys %map){ ($f=$from)=~s/\.blafasel\.de//; for my $to (keys %{$map{$from}}){ ($t=$to)=~s/\.blafasel\.de//; if( $map{$to}{$from}){ delete $map{$to}{$from}; print "$f -> $t [dir=both]\n"; }else{ print "$f -> $t \n"; }; }; }; print "}\n";