fixing a problem where failure to get the url may result in warning status
authorMatthias Förste foerste@schlittermann.de
Wed, 31 Aug 2011 15:54:49 +0200
changeset 5 cc9741ed8e84
parent 4 d1541211673e
child 6 ef829396e36a
fixing a problem where failure to get the url may result in warning status
check_release.pl
--- a/check_release.pl	Tue Jul 05 15:19:05 2011 +0200
+++ b/check_release.pl	Wed Aug 31 15:54:49 2011 +0200
@@ -90,9 +90,17 @@
 sub get_stable_release($$) {
     my ($url,   $search)         = @_;
     my ($found, $stable_release) = undef;
+    my $website;
     my @website = ();
 
-    push @website, split("\n", get($url));
+    $website = get($url);
+    unless (defined $website) {
+        print
+"RELEASE CRITICAL: failed to get $url\n";
+        exit $ERRORS{CRITICAL};
+    }
+
+    push @website, split("\n", $website);
 
     foreach (@website) {
         unless ($found) {