| 29 |
|
Generate an XHTML index page on stdout from MRTG config files specified |
| 30 |
|
on the command line or read from stdin. |
| 31 |
|
|
| 32 |
+ |
--title TITLE Use TITLE as the title of the generated page |
| 33 |
|
--help Display this help and exit |
| 34 |
|
|
| 35 |
|
Version $package_version - report bugs to $package_bugreport. |
| 36 |
|
EOF |
| 37 |
|
|
| 38 |
|
sub main () { |
| 39 |
< |
GetOptions('help' => \my $help) or die $help_text; |
| 39 |
> |
my $hostname = `hostname`; |
| 40 |
> |
chomp $hostname; |
| 41 |
> |
my $pagetitle = "MRTG: $hostname"; |
| 42 |
> |
|
| 43 |
> |
GetOptions('title=s' => \$pagetitle, |
| 44 |
> |
'help' => \my $help) or die $help_text; |
| 45 |
|
if ($help) { |
| 46 |
|
print "$help_text"; |
| 47 |
|
exit 0; |
| 59 |
|
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 60 |
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 61 |
|
<head> |
| 62 |
< |
<title>MRTG</title> |
| 62 |
> |
<title>$pagetitle</title> |
| 63 |
|
</head> |
| 64 |
|
<body> |
| 65 |
< |
<h1>MRTG</h1> |
| 65 |
> |
<h1>$pagetitle</h1> |
| 66 |
|
EOF |
| 67 |
|
foreach my $title (sort keys %pages) { |
| 68 |
|
my $page = $pages{$title}; |