#!/usr/local/bin/perl # edit_portsentry.cgi # Display portsentry configuration menu require './sentry-lib.pl'; $path = &has_command($config{'portsentry'}); if (!$path) { &ui_print_header(undef, $text{'portsentry_title'}, ""); print "
",&text('portsentry_ecommand', "$config{'portsentry'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; &ui_print_footer("", $text{'index_return'}); exit; } if (!-r $config{'portsentry_config'} && -r $config{'portsentry_alt_config'}) { system("cp $config{'portsentry_alt_config'} $config{'portsentry_config'}"); } # Get the version, if needed &read_file("$module_config_directory/portsentry", \%portsentry); @st = stat($path); if ($st[7] != $portsentry{'size'} || $st[9] != $portsentry{'mtime'}) { $out = &backquote_command("$config{'portsentry'} -v 2>&1", 1); if ($out !~ /Version:\s+(\S+)/) { &ui_print_header(undef, $text{'portsentry_title'}, ""); print "
",&text('portsentry_eversion', "$config{'portsentry'}", "$gconfig{'webprefix'}/config.cgi?$module_name"),"
\n"; &ui_print_footer("", $text{'index_return'}); exit; } $portsentry{'version'} = $1; $portsentry{'size'} = $st[7]; $portsentry{'mtime'} = $st[9]; &write_file("$module_config_directory/portsentry", \%portsentry); } &ui_print_header(undef, $text{'portsentry_title'}, "", "portsentry", 0, 0, undef, &help_search_link("portsentry", "man", "doc"), undef, undef, &text('portsentry_version', $portsentry{'version'})); if ($portsentry{'version'} >= 2) { print "
",&text('portsentry_eversion2', "$config{'portsentry'}", $portsentry{'version'}),"
\n"; &ui_print_footer("", $text{'index_return'}); exit; } # Show configuration form $conf = &get_portsentry_config(); print "
\n"; } else { print "\n"; } # Show start/stop buttons print &ui_hr(); print "