GeoHelm/geoserver/index.cgi

72 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

2024-01-27 19:04:46 +00:00
#!/usr/bin/perl
require './geoserver-lib.pl';
require './pg-lib.pl';
require '../webmin/webmin-lib.pl';
# Check if config file exists
if (! -r $config{'geoserver_config'}) {
&ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
print &text('index_econfig', "<tt>$config{'geoserver_config'}</tt>",
"$gconfig{'webprefix'}/config.cgi?$module_name"),"<p>\n";
&ui_print_footer("/", $text{"index"});
exit;
}
if(-f "$module_root_directory/setup.cgi"){
&redirect("setup.cgi?mode=checks");
exit;
}
my %version = get_acugeo_versions();
&ui_print_header("GeoServer<sup>&copy</sup> by <a href='https://www.acugis.com' target='blank'>AcuGIS</a>. Cited, Inc. 2023 ", $text{'index_title'}, "", "intro", 1, 1, 0,
&help_search_link("tomcat", "geoserver", "man", "doc", "google"), undef, undef,
"Tomcat $version{'number'} / Java $version{'jvm'}");
push(@links, "edit_manual.cgi");
push(@titles, $text{'manual_title'});
push(@icons, "images/edit-file.png");
push(@links, "edit_war.cgi");
push(@titles, $text{'wars_title'});
push(@icons, "images/war.png");
push(@links, "edit_java.cgi");
push(@titles, $text{'java_title'});
push(@icons, "images/java.png");
push(@links, "edit_geoserver.cgi");
push(@titles, $text{'extensions_title'});
push(@icons, "images/geoserver.png");
push(@links, 'http://'.$ENV{'SERVER_NAME'}.'/mapstore');
push(@titles, $text{'mapstore_title'});
push(@icons, "images/mapstoreimg.png");
&icons_table(\@links, \@titles, \@icons, 4);
# Check if tomcat is running
print &ui_hr().&ui_buttons_start();
my ($running, $status) = &tomcat_service_ctl('status');
print "$status<br>";
if ($running == 0) {
# Running .. offer to apply changes and stop
print &ui_buttons_row("stop.cgi", $text{'index_stop'}, "$text{'index_stopmsg'}");
print &ui_buttons_row("restart.cgi", $text{'index_restart'}, "$text{'index_restartmsg'}");
}else {
# Not running .. offer to start
print &ui_buttons_row("start.cgi", $text{'index_start'}, $text{'index_startmsg'});
}
#Check for an update of tomcat, once a day
my $tomcat_ver = installed_tomcat_version();
my $latest_ver = latest_tomcat_version($tomcat_ver);
if("v$tomcat_ver" ne "v$latest_ver"){
print &ui_buttons_row("tomcat_upgrade.cgi", $text{'index_upgrade'}, "Tomcat will be updated to $latest_ver. All WARs will be moved and config will be copied to new install!");
}
print &ui_buttons_end();
&ui_print_footer("/", $text{"index"});