Index: /tools/FreeBSD7_x/INSTALL.txt
===================================================================
--- /tools/FreeBSD7_x/INSTALL.txt	(revision 6664)
+++ /tools/FreeBSD7_x/INSTALL.txt	(revision 6664)
@@ -0,0 +1,63 @@
+!!! BEGIN WARNING !!!
+This script are NOT written to run in a production envirionment,
+people who has access to the subversion genesis directory all allowed to
+put marvilous code in there, which will potentially ruin your machine
+!!! END WARNING !!!!
+
+
+In order to get the genesis webinterface up and running we need to
+configure some bits and pieces:
+* Apache
+* Subversion (in order to update)
+* Perl
+
+So lets get started:
+#Make a working directory and jump to it
+$mkdir /usr/local/www/data/genesis
+$cd /usr/local/www/data/genesis
+
+#Make a checkout of the genesis directory
+$svn co http://svn.wirelessleiden.nl/svn/node-config/genesis .
+#Allow the webserver to update nodes
+$chown -R www:www nodes
+
+#Make local config file
+$mv tools/FreeBSD6_x/genesis.conf.local{.tmpl,}
+
+#Edit the following variables $home, $server, $cgi_dir (and others and
+#needed)
+$vim tools/FreeBSD6_x/genesis.conf.local
+
+Next job, apache configuration
+=== begin httpd.conf ===
+<VirtualHost *:80>
+   ServerName wlconfig
+   ServerAlias wlconfig.wzoeterwoude.net
+   ServerAlias rick.wleiden.net
+   ServerAlias 172.27.129.66
+   DocumentRoot "/usr/local/www/data/genesis"
+
+    ErrorLog "|/usr/local/sbin/rotatelogs \
+    /var/log/httpd/wlconfig.wzoeterwoude.net-error-%Y-%m-%d.log 5M"
+    CustomLog "|/usr/local/sbin/rotatelogs \
+    /var/log/httpd/wlconfig.wzoeterwoude.net-access-%Y-%m-%d.log 5M" combined
+
+
+   DirectoryIndex g_list.pl
+   AddHandler cgi-script .pl
+
+   <Directory "/usr/local/www/data/genesis">
+      Options +ExecCGI
+      AllowOverride None
+      Allow from all
+   </Directory>
+
+</VirtualHost>
+=== begin httpd.conf ===
+
+Restart apache and hit your webbrowser to the configured webpage
+
+Thats all folks :-), questions/problems/suggestions ->
+<beheer@lijst.wirelessleiden.nl> (english/dutch)
+
+/Rick <rick@wirelessleiden.nl>
Index: /tools/FreeBSD7_x/g_list.pl
===================================================================
--- /tools/FreeBSD7_x/g_list.pl	(revision 6664)
+++ /tools/FreeBSD7_x/g_list.pl	(revision 6664)
@@ -0,0 +1,327 @@
+#!/usr/bin/perl -w
+#
+# Copyright 2005 Stichting Wireless Leiden
+# Rick van der Zwet
+#
+
+# Config located at other file
+my $conf_file="./genesis.conf";
+do($conf_file) || die("Cann't open $conf_file");
+
+
+
+my $HTML=1;
+
+#laden van tool file
+do($toolfile) || die("Cann't open $toolfile");
+
+#gebruik van simple subje om ervoor te zorgen dat de print netjes in het
+#programma gestopt kan worden
+sub printline {
+  print "$_[0] \n";
+};
+
+sub filelist {
+  foreach $file ( sort @filelist) {
+    if( $HTML) {
+      print "$file<BR>\n";
+    }
+    else {
+      print "$file\n";
+    };
+  };
+}
+
+sub listnodes {
+  opendir(DIR, $ndir) || die "can't opendir $ndir: $!";
+  @tmpdirs = grep { /^[^\.]/ && -d "$ndir/$_" } readdir(DIR);
+  closedir DIR;
+  foreach $dir (sort @tmpdirs) {
+    if( not exists($removefromnodelist{$dir}) )
+    {
+      push(@nodelist, $dir);
+    }
+    else
+    {
+    if ( $debug ) { print "'$dir' removed from list\n"; }
+    }
+  };
+  return @nodelist;
+}
+
+sub nodelist {
+  foreach $node (listnodes( )) {
+    if( $HTML) {
+      print "$node<BR>\n";
+    }
+    else {
+      print "$node\n";
+    };
+  };
+}
+
+#REQUEST parsen
+$request=$ENV{'REQUEST_URI'};
+if( $request=~/.*g_list.pl\/(.*)$/) {
+  ($node,$file)=split(/\//,$1);
+  $title="$node $file";
+  if ( $debug ) { print "Node: $node\n"; }
+  if ( $debug ) { print "File: $file\n"; }
+}
+else {
+  $title="listing";
+};
+
+
+#controleer wat de browser is
+#en zorgen dan er de nodige tags geprint worden
+$browser=$ENV{'HTTP_USER_AGENT'};
+if( $browser=~/curl|wget|fetch/i) {
+  $HTML=0;
+  printline("Content-type: text/html\n\n");
+}
+else {
+  $HTML=1;
+  printline("Content-type: text/html\n\n");
+  printline("<HTML>");
+  printline("<TITLE>Genesis $title</TITLE>");
+  printline("<BODY BGcolor=white>");
+};
+
+
+#als geen node gespecificeerd dan kijken of svn geupdate is gevraagd
+if( $node eq '') {
+  if( $ENV{"QUERY_STRING"}=~/update/i) {
+    printline("<H2>Please wait while updating svn...</H2><P><PRE>");
+    select(STDERR); $| = 1;     # make unbuffered
+    select(STDOUT); $| = 1;     # make unbuffered
+    system("$svn update $ndir");
+    printline("</PRE>");
+    printline("<H2>Done.<H2><P>");
+    printline("Click <A HREF=$source>here</A>");
+    printline("if you're not forwarded automaticly in 5 seconds.<P>");
+    printline("<META HTTP-EQUIV=REFRESH CONTENT=5;URL=$source>");
+  }
+  else {
+   g_list( );
+  }
+}
+elsif( $node eq 'filelist' ) {
+  filelist( );
+}
+elsif( $node eq 'nodelist' ) {
+  nodelist( );
+}
+else {
+  if( $file eq '') {
+      filelist( );
+  }
+  elsif( $file eq 'config') {
+    g_print($hostname);
+  }
+  else {
+    foreach my $tmpFile ( sort @filelist) {
+      if( $file eq $tmpFile ) {
+        g_generate($file);
+      };
+    };
+  };
+};
+
+#plaats de sluit HTML tags
+if( $HTML) {
+  print <<EOF;
+</BODY>
+</HTML>
+EOF
+}
+
+
+#Het opbouwen van het begin scherm
+sub g_list {
+  if( $HTML) {
+    my $svn_version=svn_version("$ndir");
+    if( $svn_version=~/Last Changed Rev: (\d+)/) {
+      $revision=$1;
+    };
+    printline("<H1>Genesis config - last changed rev $revision</H1><P>\n<PRE>");
+    printline("$svn_version");
+    printline("</PRE>");
+    printline("<FORM METHOD=get ACTION=$source>");
+    printline('<INPUT TYPE="submit" NAME="Update" VALUE="Update">');
+    printline("</FORM>");
+    printline("<TABLE BORDER=1>");
+  };
+
+  @dirs = listnodes( );
+  foreach $dir (sort @dirs) {
+    if( $dir=~/attic/ ) {
+      next;
+    };
+    my $node = $dir;
+    if( ! $HTML ) {
+      print "$node\n";
+    }
+    else {
+      printline("<TR><TD><A HREF=g_list.pl/$node/config>$node</A></TD>");
+      foreach $file (sort @filelist) {
+        printline("<TD><A HREF=g_list.pl/$node/$file>$file</A></TD>\n");
+      };
+    };
+  };
+  if( $HTML ) {
+    printline("</TABLE><P>");
+  };
+};
+
+
+
+#ophalen svn versie
+sub svn_version {
+  local($file,$char)=@_;
+  local($svn_version);
+  $svn_version=`$svn info $file`;
+  if( $char ne '' ) {
+    $svn_version=~s/^([^$char].*)/$char $1/mgi;
+  };
+  return($svn_version);
+};
+
+
+
+#netjes de configuratie printen
+sub g_print {
+  my $config="$ndir/$node/$configfile";
+  parse_config($config);
+    
+ printline("<H1>Genesis configuratie voor: $node</H1><P>");
+ printline("<PRE>" . svn_version($config) . "</PRE><P>");
+
+
+ my $TP='';
+ if( $tproxy !~ m/no/i ) {
+   $TP .= "\n";
+   $TP .= "Tproxy on cidr range $tproxy";
+   $TP .= "<b>WARNING - specification propably wrong - should be a cidr</b>"
+   unless $tproxy =~ m/\d+\.\d+\.\d+\.\d+\/\d+/;
+ };
+
+ printline("<TABLE BORDER=1><TR><TD COLSPAN=4><PRE>");
+ printline("master_ip=$master_ip");
+ printline("AGGREGATE=$AGGREGATE");
+ printline("");
+ printline("gw_open=$gw_open");
+ printline("nodetype=$nodetype");
+ printline("nodename=$nodename");
+ printline("");
+ printline("NS_forward=$NS_forward");
+ printline("NS_resolv=$NS_resolv");
+ printline("");
+ printline("location=$location");
+ printline("DISK=$DISK");
+ printline("");
+ printline("X=$X");
+ printline("Y=$Y");
+ printline("");
+ printline("OS=$OS");
+ printline("");
+ printline("$TP");
+ printline("</PRE></TD></TR>");
+
+ foreach $if( sort keys %config) {
+   if( $if=~/^(.*):\d+/ ) {
+     $subs{$1}++;
+   };
+ };
+
+ foreach $if( sort keys %config) {
+   if( $if=~/^([^:]+)/ ) {
+     $mymain=$1;
+   }
+   else {
+     $mymain='';
+   };
+   
+   if( $if!~/:\d+/ ) {
+     $main=1;$cc='66'
+   }
+   else {
+     $main=0;
+     $cc='cc';
+   };
+   
+   if(! ($ip=$IP{$if}) ) {
+     $ip='dhcp?';
+   };
+   if( $TYPE{$if}=~/wireless/ ) {
+     $color="#${cc}FFFF";
+   };
+   if( $TYPE{$if}=~/ethernet/) {
+     $color="#FFFF${cc}";
+   };
+   
+   $cfg=$config{$if};
+   $cfg=~s/(.*KEY.*=).*/${1}***********/;
+   $cfg=~s/(.*PWD.*=).*/${1}***********/;
+   $cfg=~s/(.*CODE.*=).*/${1}***********/;
+   $cfg=~s/(.*PASS.*=).*/${1}***********/;
+
+   if( $main) {
+     printf "<TR bgcolor=$color><TD ROWSPAN=%d VALIGN=TOP><B>$if</TD>\n",(1+$subs{$if})*3,$subs{$if};
+     $c=4;
+   }
+   else {
+     $c=3;
+     print "<TR bgcolor=$color>";
+   };
+   $cfg=~s/</&lt;/gi;
+   $cfg=~s/>/&gt;/gi;
+
+   printline("<TD>$if</TD><TD><B>$ip</TD><TD>$DESC{$if}($SDESC{$if})</TD>");
+   printline("<TR><TD COLSPAN=$c><PRE>");
+   printline("$cfg");
+   printline("</PRE></TD>");
+   printline("<TR><TD COLSPAN=$c>&nbsp;</TD>");
+ };
+ printline("</TABLE>");
+};
+
+
+
+#Generen config
+sub g_generate {
+  my $file=$_[0];
+  $config="$ndir/$node/$configfile";
+  $svn_versiont=svn_version($toolfile,$char);
+  $svn_versionc=svn_version($config,$char);
+
+  if( $svn_versiont=~/Last Changed Rev: (\d+)/ ) {
+    $tool_rev=$1;
+  };
+  if( $svn_versionc=~/Last Changed Rev: (\d+)/ ) {
+  $config_rev=$1;
+  };
+
+  if( $tool_rev >= $config_rev) {
+    $svn_version=$svn_versiont . $svn_versionc;
+  }
+  else {
+    $svn_version=$svn_versionc;
+  };
+
+  if( $HTML) {
+    printline("<H1>Genesis $file voor: $hostname</H1><P>");
+  };
+
+  parse_config($config);
+  $pr=do_it($file);
+
+
+  if( $HTML ) {
+    $pr=~s/</&lt;/gi;
+    printline("<PRE>$pr</PRE>");
+  }
+  else {
+    print $pr;
+  };
+};
Index: /tools/FreeBSD7_x/genesis.conf
===================================================================
--- /tools/FreeBSD7_x/genesis.conf	(revision 6664)
+++ /tools/FreeBSD7_x/genesis.conf	(revision 6664)
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+#
+# Variable file
+
+$NG = 0;
+
+#debugging variable
+$debug=0;
+
+#author credits
+$author="feb 2003 jasper\@WirelessLeiden.NL \| maart 2005 rick\@WirelessLeiden.NL";
+
+#filelist
+@filelist = ();
+$filelist[0]="dhcpd.conf";
+$filelist[1]="rc.node.local";
+$filelist[2]="resolv.conf";
+$filelist[3]="named.conf";
+$filelist[4]="txtconfig";
+$filelist[5]="authorized_keys";
+
+#Ignore this node diretories
+%removefromnodelist = (
+                      'retired' => 'YES',
+                      'obsolete' => 'YES',
+                       );
+
+#(inter)net env
+if( defined $ENV{'SERVER_NAME'} ) {
+  $hostname=$ENV{'SERVER_NAME'};
+}
+else {
+  $hostname=`hostname`;
+};
+
+chomp($hostname);
+$cgi_dir="http://$hostname/freebsd/6.0";
+$source="$cgi_dir/g_list.pl";
+
+#path variablen
+$home="/usr/local/www/wlconfig.wirelessleiden.nl";
+$ndir="$home/nodes";
+$toolfile="$home/freebsd/6.0/wleiden.pl";
+
+
+#exec vars
+$svn="/usr/local/bin/svn";
+$wicontrol='/usr/sbin/wicontrol';
+
+#naming vars
+$configfile="wleiden.conf";
+
+#module IP.pm
+$IP_pmPath="$home/tools/IP.pm";
+
+#dnsheader.conf
+$dnsheader_confPath="$home/dns/dnsheader.conf";
+
+
+## ssh key variablen ##
+#global ssh_keys
+$global_keyPath="$home/nodes/global_keys";
+#node specific
+$ssh_file='ssh_key'
+
Index: /tools/FreeBSD7_x/genesis.conf.local.tmpl
===================================================================
--- /tools/FreeBSD7_x/genesis.conf.local.tmpl	(revision 6664)
+++ /tools/FreeBSD7_x/genesis.conf.local.tmpl	(revision 6664)
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+#
+# Local variable file
+
+#path variablen
+$home="/usr/local/www/data/genesis";
+$conf_file="$home/tools/FreeBSD6_x/genesis.conf";
+
+
+#(inter)net env
+if( defined $ENV{'SERVER_NAME'} ) {
+  $hostname=$ENV{'SERVER_NAME'};
+}
+else {
+  $hostname=`hostname`;
+};
+
+chomp($hostname);
+$cgi_dir="http://$hostname/freebsd/6.0";
+$source="$cgi_dir/g_list.pl";
+
+#exec vars
+$svn="/usr/local/bin/svn";
+$wicontrol='/usr/sbin/wicontrol';
+
Index: /tools/FreeBSD7_x/wleiden.pl
===================================================================
--- /tools/FreeBSD7_x/wleiden.pl	(revision 6664)
+++ /tools/FreeBSD7_x/wleiden.pl	(revision 6664)
@@ -0,0 +1,307 @@
+#!/usr/bin/perl -w
+#
+# Copyright 2005 Stichting Wireless Leiden
+# maart 2004 rick@wirelessleiden.nl
+#
+
+# Config located at other file
+my $conf_file="./genesis.conf";
+do($conf_file) || die("Cann't open $conf_file");
+################ END OF CONFIG ##########################
+
+#variablen
+my $time=gmtime();
+my $source=`/bin/hostname`;
+chomp($source);
+
+
+#slurp IP berekeningen info
+do ("$IP_pmPath") || die ("Cann't open $IP_pmPath");
+#slurp dns info
+do ("$dnsheader_confPath") || die ("Cann't open $dnsheader_confPath");
+
+
+#zoek uit of het master_ip addr voorkomt in de configs
+#belangrijk van aliassen
+sub master_ipNotUsed {
+  if( $debug ) {
+    print "running master_ipNotUsed...\n";
+  }
+  foreach my $if (keys %config) {
+    if( $IP{$if} =~ /([0-9\.]+).*/ ) {
+      if( $1 eq $master_ip ) {
+        return(0);
+      };
+    };
+  };
+  return(1);
+};
+
+
+
+sub genHeader {
+  my $comment = $_[0];
+  my $output =
+  "$comment This file specific to wireless\n" .
+  "$comment leiden. Please make all changes in Genesis.\n" .
+  "$comment\n" .
+  "$comment Generated by $source\n" .
+  "$comment on $time\n" .
+  "$comment\n" .
+  "$comment  $author\n" .
+  "$comment\n\n\n";
+  return ($output);
+};
+
+
+sub txtconfig {
+  my $output = "";
+  foreach $interface (keys %config) {
+    $output .= $config{$interface};
+  };
+  return($output);
+};
+
+
+sub dhcpd_conf {
+  my $output = genHeader("#");
+  $output .=
+  "option domain-name \"$domain\";\n" .
+  " \n" .
+  "default-lease-time 7200;\n" .
+  "max-lease-time 2592000;\n" .
+  "\n" .
+  "ddns-update-style none;\n" .
+  "\n" .
+  "# Hack for the WET11\n" .
+  "#\n" .
+  "always-broadcast on;\n" .
+  "\n" .
+  "option domain-name-servers ${master_ip};\n" .
+  "\n";
+
+  foreach my $interface (sort keys %config) {
+    if( $interface =~ /^[a-z]+[0-9]+$/i ) {
+      (my $ip, my $netmask) = split('/', $IP{$interface});
+      my $subnet = IP::toSubnet($netmask);
+      my $broadcast = IP::getBroadcastAddr($ip, $subnet);
+      my $network = IP::getNetworkAddr($ip, $subnet);
+      
+      $output .=
+      "# $interface $DESC{$interface}\n";
+      
+      if ( $DHCP{$interface} =~ /[0-9]+\-[0-9]+/i ) {
+        my $dhcp_part = $ip;
+        $dhcp_part =~ s/[0-9]+$//;
+        (my $dhcp_start, my $dhcp_stop) = $DHCP{$interface} =~ /([0-9]+)\-([0-9]+)/i;
+        $dhcp_start = $dhcp_part . $dhcp_start;
+        $dhcp_stop = $dhcp_part . $dhcp_stop;
+        $output .=
+        "subnet $network netmask $subnet {\n" .
+        "  range $dhcp_start $dhcp_stop;\n" .
+        "  option broadcast-address $broadcast;\n" .
+        "  option subnet-mask $subnet;\n" .
+        "  option routers $ip;\n" .
+	$DHCP_STATIC{$if} .
+        "}\n" .
+        "\n";
+      }
+      else {
+       $output .=
+       "subnet $network netmask $subnet {not authoritative; }\n" .
+       "\n";
+      };
+    };
+  };
+  
+  return($output);
+};
+
+sub named_conf {
+  my $output = genHeader("#");
+  $output .=
+  "options {\n" .
+  "  directory \"/etc/namedb\"\;\n" .
+  "  pid-file \"/var/run/named/pid\"\;\n" .
+  "  forwarders {\n";
+  foreach my $forward (@forwarder) {
+    $output .= "$forward;\n";
+  };
+  $output .= 
+  "  };\n" .
+  "};\n" .
+  "\n" .
+  "\n" .
+  "zone \"\.\" {\n" .
+  "  type hint;\n" .
+  "  file \"/etc/namedb/named.root\"\;\n" .
+  "}\;\n" .
+  "\n" .
+  "zone \"0\.0\.127\.IN-ADDR.ARPA\" {\n" .
+  "  type master\;\n" .
+  "  file \"/etc/namedb/master/localhost.rev\"\;\n" .
+  "}\;\n" .
+  "\n" .
+  "zone \"1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.INT\" {\n" .
+  "  type master\;\n" .
+  "  file \"/etc/namedb/master/localhost-v6.rev\"\;\n" .
+  "};\n" .
+  "\n";
+
+
+  foreach my $tmpZone (sort keys %zone) {
+    my $dnsZone = $zone{$tmpZone};
+    $output .= 
+    "zone \"$tmpZone\" {\n" .
+    "  type slave\;\n" .
+    "  file \"slave/slave-$tmpZone\"\;\n" .
+    "  masters {\n";
+    foreach my $tmpIP (sort @$dnsZone) {
+      $output .= "    $tmpIP\;\n";
+    };
+    $output .= 
+    "  };\n" .
+    "};\n" .
+    "\n";
+  };
+  
+  return($output);
+};
+
+
+
+sub rc_node_local {
+  my $output = genHeader("#");
+  my $masterNotUsed = master_ipNotUsed();
+  $output.=
+  "hostname=\"$nodetype$nodename.$domain\"\n" .
+  "location=\"$location\"\n" .
+  "\n";
+
+  if( $tproxy ) {
+    if( $tproxy =~ m/\d+\.\d+\.\d+\.\d+\/\d+/ ) {
+      $output .=
+      "# Tproxy is ran on this system\n".
+      "tproxy_enable='YES'\n".
+      "tproxy_range='$tproxy'\n".
+      "\n";
+    }
+    elsif( $tproxy !~ m/no/i ) {
+      $output .= "# WARNING - specification propably wrong - check " .
+      "genesis. It should be a pure CIDR\n";
+    };
+  };
+  
+  $output .= "ifconfig_lo0_alias0=\"inet 172.31.255.1/32\"\n";
+  if( $masterNotUsed ) {
+    $output .= "ifconfig_lo0_alias1=\"inet $master_ip/32\"\n\n";
+  }
+  else {
+    $output .= "#ifconfig_lo0_alias1=\"inet $master_ip/32\"\n\n";
+  };
+
+  foreach my $interface (sort keys %config) {
+    (my $if, my $number) = split(/:/, $interface);
+      if( defined $number ) {
+        $output .= "ifconfig_$if\_alias$number=\"inet $IP{$interface}\"\n";
+      }
+      else {
+        $output .= "ifconfig_$if=\"inet $IP{$interface}";
+        $output .= " $CARD_OPTION{$interface}";
+        if( $TYPE{$if} =~ /wireless/i ) {
+          $output .= " ssid $ESSID{$interface}";
+          if( $MODE{$if}=~/master/i ) {
+            $output .= " channel $CHANNEL{$interface}";
+            $output .= " mediaopt hostap";
+          }
+          else {
+            $output .= "";
+          };
+        };
+        $output .= "\"\n";
+      };
+  };
+  return($output);
+};
+
+
+sub resolv_conf {
+  my $output = genHeader"#";
+
+  $output .= 
+  "search wleiden.net.\n" .
+  "nameserver 127.0.0.1\n" .
+  "\n";
+
+  foreach my $if (sort keys %config) {
+    if( exists $POINT_TO_POINT{$if} ) {
+      foreach my $ip ($POINT_TO_POINT{$if}) {
+        $output .= "nameserver $ip # $DESC{$if}\n";
+      };
+    };
+  };
+  return($output);
+};
+
+
+sub parse_config {
+  my $workingfile = $_[0];
+  do($workingfile) || die("Cann't open/parse $workingfile");
+  foreach my $if (keys %config) {
+    my $cfg=$config{$if};
+    while ($cfg) {
+      $cfg=~s/^([^\n\r]+)[\r\n]*//m;
+      my $line=$1;
+      $line=~s/\s*#.*//;
+      if (((my $name, my $value)=split(/=/,$line)) eq 2) {
+        my $doit="if (exists(\$$name\{\"$if\"\})) {\$$name\{\"$if\"\}.=\";$value\";} else {\$$name\{\"$if\"\}.=\"$value\";}";
+        eval($doit);
+      };
+      $cfg=~s/[\r\n]*$//m;
+    };
+  };
+};
+
+sub authorized_keys {
+  my $output = genHeader("#");
+  if( -e "$global_keyPath" ) {
+    open( GLOBAL, "$global_keyPath" ) || die ("Cann't open $global_keyPath");
+      $output .= join("", <GLOBAL>);
+    close( GLOBAL );
+  }
+  else {
+    $output .= "# No $global_keyPath\n";
+  };
+ 
+  if( -e "$ndir/$nodetype$nodename/$ssh_file" ) {
+    open( NODE, "$ndir/$nodetype$nodename/$ssh_file" ) || die ("Cann't open $home/$nodename/$ssh_file");
+      $output .= join("", <NODE>);
+    close( NODE );
+  }
+  else {
+    $output .= "# No $ndir/$nodetype$nodename/$ssh_file\n";
+  };
+  
+  return($output);
+};
+
+sub do_it {
+  my $file = $_[0];
+  my $body = "";
+  
+  $file =~ s/\./_/g;
+  $body=&$file;
+  return($body);
+};
+
+if( exists $ARGV[0] ) {
+  if( exists $ARGV[1] ) {
+    parse_config($ARGV[0]);
+    print do_it($ARGV[1]);
+  }
+  else {
+    print "Usage `perl wleiden.pl 'inputfile' 'outputfile'`\n";
+  };
+};
+
+1;
