-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.cgi
92 lines (69 loc) · 2.53 KB
/
index.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/perl
# index.cgi
require './tomcat-lib.pl';
require '../webmin/webmin-lib.pl'; #for OS detection
require './checks-lib.pl';
# Check if config file exists
if (! -r $config{'jri_publisher_config'}) {
&ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1);
print &text('index_econfig', "<tt>$config{'jri_publisher_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_catalina_version();
&ui_print_header(undef, $text{'index_title'}, "", "intro", 1, 1, 0,
&help_search_link("tomcat", "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_libs.cgi");
push(@titles, $text{'libs_title'});
push(@icons, "images/jar.png");
push(@links, "edit_java.cgi");
push(@titles, $text{'java_title'});
push(@icons, "images/java.png");
#push(@links, "edit_proxy.cgi");
#push(@titles, $text{'proxy_title'});
#push(@icons, "images/mapping.png");
push(@links, "edit_datasource.cgi");
push(@titles, $text{'jru_title'});
push(@icons, "images/jr_ds.png");
push(@links, "edit_publish.cgi");
push(@titles, $text{'jru_publish'});
push(@icons, "images/jr_publish.png");
push(@links, "edit_schedule.cgi");
push(@titles, $text{'jru_schedule'});
push(@icons, "images/jr_schedule.png");
push(@links, "edit_template.cgi");
push(@titles, $text{'template_title'});
push(@icons, "images/template.png");
push(@links, "edit_reports.cgi");
push(@titles, $text{'jri_reports'});
push(@icons, "images/jri_reports.png");
push(@links, "security.cgi");
push(@titles, $text{'security_title'});
push(@icons, "images/security.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 == 1) {
# 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'});
}
print ui_buttons_end();
&ui_print_footer("/", $text{"index"});