#!/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 "\n"; system("$config{'shorewall'} status 2>&1"); if ($?) { # Down .. offer to start # unless no permissions unless ($access{'nochange'}) { print "\n"; print "\n"; print "\n"; print "\n"; } } else { # Up .. offer to restart, clear and stop # unless nochange is set unless ($access{'nochange'}) { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; print "\n"; print "\n"; } # Always offer to check print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'index_startdesc'}
$text{'index_restartdesc'}
$text{'index_refreshdesc'}
$text{'index_cleardesc'}
$text{'index_stopdesc'}
$text{'index_statusdesc'}
$text{'index_checkdesc'}
$text{'index_dumpdesc'}
\n"; } } &ui_print_footer("/", $text{'index'});