#!/usr/bin/perl # index.cgi # Display icons for the various shorewall configuration files require './shorewall-lib.pl'; if (!&has_command($config{'shorewall'})) { &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); print "
",&text('index_ecmd', "$config{'shorewall'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; } else { # Get the version $shorewall_version = &get_shorewall_version(1); &open_tempfile(VERSION, ">$module_config_directory/version"); &print_tempfile(VERSION, $shorewall_version,"\n"); &close_tempfile(VERSION); &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &help_search_link("shorewall", "doc", "google"), undef, undef, &text('index_version', &get_printable_version($shorewall_version))); if (!-d $config{'config_dir'}) { # Config dir not found! print "
",&text('index_edir', "$config{'config_dir'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n";
}
else {
# Just show the file icons
@files = grep { &can_access($_) } @shorewall_files;
@titles = map { $text{&clean_name($_)."_title"}."
($_)" } @files;
@links = map { "list.cgi?table=".$_ } @files;
@icons = map { "images/".$_.".gif" } @files;
&icons_table(\@links, \@titles, \@icons, 4);
# Check if shorewall is running by looking for the 'shorewall'
# chain in the filter table
print &ui_hr();
print "