#!/usr/local/bin/perl # index.cgi # Show fetchmail configurations require './fetchmail-lib.pl'; &ui_print_header(undef, $text{'index_title'}, "", undef, 0, 1); # Check if fetchmail is installed if (!&has_command($config{'fetchmail_path'})) { print &text('index_efetchmail', "$config{'fetchmail_path'}"),"

\n"; &ui_print_footer("/", $text{'index'}); exit; } @conf = &parse_config_file($fetchmail_config); @conf = grep { $_->{'poll'} } @conf; &show_polls(\@conf, $fetchmail_config, $remote_user_info[0]); if (@conf) { # Show the fetchmail daemon form print "


\n"; print "\n"; if (&foreign_check("cron")) { # Show button to manage cron job print "\n"; print "\n"; print "\n"; } print "\n"; print "\n"; } else { # daemon isn't running - offer to start it print "\n"; print "\n"; print "\n"; } print "
$text{'index_crondesc'}
\n"; foreach $pf ("$remote_user_info[7]/.fetchmail.pid", "$remote_user_info[7]/.fetchmail") { if (open(PID, $pf) && ($line=) && (($pid,$interval) = split(/\s+/, $line)) && $pid && kill(0, $pid)) { $running = $pf; last; } } if ($running) { # daemon is running - offer to stop it print "
\n"; print "
",&text('index_stopmsg', $interval),"",&text('index_startmsg', ""),"
\n"; } &ui_print_footer("/", $text{'index'});