check_avwebgate.pl
changeset 12 99ed3413c15a
parent 5 e061bc121954
child 14 434f50dc22c0
equal deleted inserted replaced
11:697ef98b8483 12:99ed3413c15a
    12 
    12 
    13 sub print_help();
    13 sub print_help();
    14 sub print_usage();
    14 sub print_usage();
    15 
    15 
    16 my $ME = basename $0;
    16 my $ME = basename $0;
       
    17 my $VERSION = '1.1';
       
    18 
    17 my ( $opt_u, $opt_s, $opt_V, $opt_h, $opt_b );
    19 my ( $opt_u, $opt_s, $opt_V, $opt_h, $opt_b );
    18 my ( $result, $found, $message, $version, $current_version );
    20 my ( $result, $found, $message, $version, $current_version );
    19 
    21 
    20 $opt_u = 'http://www.avira.com/de/support-download-avira-antivir-webgate';
    22 $opt_u = 'http://www.avira.com/de/support-download-avira-antivir-webgate';
    21 $opt_s = '<a.*>Avira AntiVir WebGate / Avira WebGate Suite</a>.*(?:\n.*){4}<td>(\d+\.\d+\.\d+\.[\d-]+)</td>';
    23 $opt_s = '<a.*>Avira AntiVir WebGate / Avira WebGate Suite</a>.*(?:\n.*){4}<td>(\d+\.\d+\.\d+\.[\d-]+)</td>';
    34     "s=s"            => \$opt_s,
    36     "s=s"            => \$opt_s,
    35     "search=s"       => \$opt_s
    37     "search=s"       => \$opt_s
    36 );
    38 );
    37 
    39 
    38 if ($opt_V) {
    40 if ($opt_V) {
    39     print_revision( $ME, "0.1" );
    41     print_revision( $ME, $VERSION );
    40     exit $ERRORS{"OK"};
    42     exit $ERRORS{"OK"};
    41 }
    43 }
    42 
    44 
    43 if ($opt_h) {
    45 if ($opt_h) {
    44     print_help();
    46     print_help();
    85     print "  $ME [-h | --help]\n";
    87     print "  $ME [-h | --help]\n";
    86     print "  $ME [-V | --version]\n";
    88     print "  $ME [-V | --version]\n";
    87 }
    89 }
    88 
    90 
    89 sub print_help() {
    91 sub print_help() {
    90     print_revision( $ME, "0.1" );
    92     print_revision( $ME, $VERSION );
    91     print "Copyright (c) 2008 Christian Arnold\n\n";
    93     print "Copyright (c) 2008 Christian Arnold\n\n";
    92     print "This plugin checks for new versions of Avira AntiVir WebGate.\n\n";
    94     print "This plugin checks for new versions of Avira AntiVir WebGate.\n\n";
    93     print_usage();
    95     print_usage();
    94     print "\n";
    96     print "\n";
    95     print "  -b, --binary <binary>\n";
    97     print "  -b, --binary <binary>\n";