[BACK]Return to fsmgrhtml.sh CVS log [TXT][DIR] Up to [Development] / failsafe / FailSafe-mgr / web / FailSafeManager

File: [Development] / failsafe / FailSafe-mgr / web / FailSafeManager / fsmgrhtml.sh (download)

Revision 1.10, Thu Mar 15 02:16:14 2001 UTC (16 years, 7 months ago) by aseel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines

- Extended Support for server-side properties to remaining tasks and views.
- Removed (commented out) GUI components that point to the log viewer
  while readlog is being ported.

#!/usr/bin/perl
#
# Generate a localized web page for FailSafe Manager.
#

$plugin = 1;
$ENV{'NOPLUGIN'} = 0;
if ($#ARGV > -1 && $ARGV[0] =~ "-noplugin") {
    $ENV{'NOPLUGIN'} = 1;
    $plugin = 0;
}

$fsmgrdir = "/home/httpd/html/FailSafeManager";

#
# Environment variables pass information to applettag program
#
$ENV{'JARDIR'} = $fsmgrdir;
$ENV{'CODE'} = "com.sgi.fsmgr.FsmgrApplet";
$ENV{'WIDTH'} = "41";
$ENV{'HEIGHT'} = "41";
$ENV{'ALIGN'} = "TOP";
$ENV{'JARFILES'} = "fsmgr.jar sysadm.jar";

#
# Find localized fsmgr.html.
#
$lang = `/usr/lib/sysadm/web/browserlang`;
$file = "$fsmgrdir/fsmgr_$lang.html";

while (! -f $file) {
    $newFile = $file;
    $newFile =~ s/_[^_]*.html/.html/;
    if ("$file" =~ "$newFile") {
	die "Error: no .html file found for fsmgr.html\n";
    }
    $file = $newFile;
}

#
# Find localized plugin info.
#
if (!$plugin) {
    $pluginInfo = "$fsmgrdir/noplugin-info_$lang.html";
} else {
    $pluginInfo = "$fsmgrdir/plugin-info_$lang.html";
}
while (! -f $pluginInfo) {
    $newFile = $pluginInfo;
    $newFile =~ s/_[^_]*.html/.html/;
    if ("$pluginInfo" =~ "$newFile") {
	die "Error: no .html file found for $pluginInfo\n";
    }
    $pluginInfo = $newFile;
}

#
# Replace <FSMGR-APPLET> in html file with appropriate applet tag,
# with localized archive setting.
#
open(FILE, $file) || die("$file: $!\n");
while ($line = <FILE>) {
    if ($line =~ "<FSMGR-APPLET>") {
	print `/usr/lib/sysadm/web/applettag`;
    } elsif ($line =~ "<PLUGIN-INFO>") {
	open(INFO, $pluginInfo) || die("$pluginInfo: $!\n");
	while ($info = <INFO>) {
	    print $info;
	}
	close(INFO);
    } else {
	print "$line";
    }
}
close(FILE);