--- projects/libstatgrab/src/statgrab/statgrab-make-mrtg-index.in 2003/08/28 11:26:42 1.1 +++ projects/libstatgrab/src/statgrab/statgrab-make-mrtg-index.in 2003/11/07 12:34:22 1.3 @@ -29,13 +29,19 @@ Usage: $progname [OPTION]... [CONFIGFILE]... Generate an XHTML index page on stdout from MRTG config files specified on the command line or read from stdin. +--title TITLE Use TITLE as the title of the generated page --help Display this help and exit Version $package_version - report bugs to $package_bugreport. EOF sub main () { - GetOptions('help' => \my $help) or die $help_text; + my $hostname = `hostname`; + chomp $hostname; + my $pagetitle = "MRTG: $hostname"; + + GetOptions('title=s' => \$pagetitle, + 'help' => \my $help) or die $help_text; if ($help) { print "$help_text"; exit 0; @@ -53,17 +59,19 @@ sub main () { "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> - MRTG + $pagetitle -

MRTG

+

$pagetitle

EOF foreach my $title (sort keys %pages) { my $page = $pages{$title}; print "

$title

\n"; - print "\n"; + print "

\"$page\"/

\n"; } print <Generated by +libstatgrab version $package_version.

EOF