Jelajahi Sumber

Break out of testing if a new parameter is required

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1301 f882894a-f735-0410-b71e-b25c423dba1c
Ton Voon 20 tahun lalu
induk
melakukan
9c89de133b
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 6 0
      NPTest.pm

+ 6 - 0
NPTest.pm

@@ -53,6 +53,10 @@ developer to interactively request test parameter information from the
 user. The user can accept the developer's default value or reply "none"
 user. The user can accept the developer's default value or reply "none"
 which will then be returned as "" for the test to skip if appropriate.
 which will then be returned as "" for the test to skip if appropriate.
 
 
+If a parameter needs to be entered and the test is run without a tty 
+attached (such as a cronjob), this routine will die causing the test to 
+fail.
+
 Responses are stored in an external, file-based
 Responses are stored in an external, file-based
 cache so subsequent test runs will use these values. The user is able
 cache so subsequent test runs will use these values. The user is able
 to change the values by amending the values in the file /var/tmp/NPTest.pm,
 to change the values by amending the values in the file /var/tmp/NPTest.pm,
@@ -342,6 +346,8 @@ sub getTestParameter
     return $default;
     return $default;
   }
   }
 
 
+  die "Need to manually enter test parameter $param" unless (-t STDERR);
+
   my $userResponse = "";
   my $userResponse = "";
 
 
   while ( $userResponse eq "" )
   while ( $userResponse eq "" )