#!/bin/bash # Copyright (c) Michael Still 2001, released under the terms of the GNU GPL down=`cat /tmp/$3` col=`cat /tmp/$3-col` if [ $2 -gt 0 ] then localname=`echo $1 | sed 's/^.*\///'` if [ -f $1/$localname-info ] then if [ `find $1 -type f | wc -l | tr -d " "` -lt 2 ] then echo -n "textbox" $(( $down * 10 )) $(( $2 * 20 + $col )) $(( $down * 10 + 10 )) 500 else echo -n "textbox" $(( $down * 10 )) $(( $2 * 20 )) $(( $down * 10 + 10 )) 500 fi echo -n " \"$localname \\("`grep Name $1/$localname-info | tail -1 | sed 's/Name: //' | sed 's/.canberra.edu.au//'``grep Location $1/$localname-info | tail -1 | sed 's/Location://'``grep Role $1/$localname-info | tail -1 | sed 's/Role://'` echo "\\)\"" down=$(( $down + 1 )) # If down is the magical amount then you need to make a new page if [ $down -gt 80 ] then down=1 echo newpage fi fi fi # There might be hosts that don't have any more of a route from here for item in `find $1 -type f -maxdepth 1 | egrep -v ^$1/$localname-info$` do echo -n "textbox" $(( $down * 10 )) $(( $2 * 20 + $col + 20 )) $(( $down * 10 + 10 )) 500 echo " \""`echo $item | sed 's/^.*\///' | sed 's/-info//'` "\\("`grep Name $item | tail -1 | sed 's/Name: //' | sed 's/.canberra.edu.au//'``grep Location $item | tail -1 | sed 's/Location://'``grep Role $item | tail -1 | sed 's/Role://'`"\\)\"" down=$(( $down + 1 )) # If down is the magical amount then you need to make a new page if [ $down -gt 80 ] then down=1 echo newpage fi done echo $down > /tmp/$3 echo $col > /tmp/$3-col # For each of the entries at this level for item in `find $1 -type d -maxdepth 1 | egrep -v ^$1$` do ./genlevel $item $(( $2 + 1 )) $3 done