Changeset 11293


Ignore:
Timestamp:
2006-03-01T10:36:17+13:00 (18 years ago)
Author:
mdewsnip
Message:

Added a new "check-installation" command to check that Java is installed correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/gliserver.pl

    r11148 r11293  
    11#!perl -w
    2 # Need to specify the full path of Perl above on Unix
     2# Need to specify the full path of Perl above
    33
    44
     
    4040    $gsdl_cgi->delete("cmd");
    4141
    42     # All commands require a username, for locking and authentication
     42    # The check-installation command has no arguments
     43    if ($cmd eq "check-installation") {
     44    &check_installation($gsdl_cgi);
     45    return;
     46    }
     47
     48    # All other commands require a username, for locking and authentication
    4349    my $username = $gsdl_cgi->clean_param("un");
    4450    if ((!defined $username) || ($username =~ m/^\s*$/)) {
     
    194200
    195201
     202sub check_installation
     203{
     204    my ($gsdl_cgi) = @_;
     205
     206    # Check that Java is installed and accessible
     207    my $java = $gsdl_cgi->get_java_path();
     208    my $java_command = "$java -version 2>&1";
     209    my $java_output = `$java_command`;
     210    my $java_status = $?;
     211    if ($java_status < 0) {
     212    $gsdl_cgi->generate_error("Java failed -- do you have the Java run-time installed?\n" . $gsdl_cgi->check_java_home());
     213    }
     214
     215    $gsdl_cgi->generate_ok_message("Java found: $java_output\nInstallation OK!");
     216}
     217
     218
    196219sub delete_collection
    197220{
Note: See TracChangeset for help on using the changeset viewer.