diff options
-rw-r--r-- | contrib/check_rbl.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/contrib/check_rbl.c b/contrib/check_rbl.c index 69fdd23..6831b65 100644 --- a/contrib/check_rbl.c +++ b/contrib/check_rbl.c | |||
@@ -22,6 +22,9 @@ | |||
22 | #include "string.h" | 22 | #include "string.h" |
23 | 23 | ||
24 | const char progname = "check_rbl"; | 24 | const char progname = "check_rbl"; |
25 | const char *revision = "$Revision$"; | ||
26 | //const char *copyright = "2000-2003"; | ||
27 | //const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
25 | 28 | ||
26 | int process_arguments(int, char **); | 29 | int process_arguments(int, char **); |
27 | int call_getopt(int, char **); | 30 | int call_getopt(int, char **); |
@@ -48,7 +51,7 @@ int main(int argc, char **argv){ | |||
48 | usage("Cannot catch SIGALRM\n"); | 51 | usage("Cannot catch SIGALRM\n"); |
49 | 52 | ||
50 | if (process_arguments(argc,argv)!=OK) | 53 | if (process_arguments(argc,argv)!=OK) |
51 | usage("Could not parse arguments\n"); | 54 | usage (_("check_rbl: could not parse arguments\n")); |
52 | 55 | ||
53 | /* reverse the octets in the IP address */ | 56 | /* reverse the octets in the IP address */ |
54 | query_address_rev = reverse_ipaddr(query_address); | 57 | query_address_rev = reverse_ipaddr(query_address); |
@@ -127,7 +130,7 @@ int main(int argc, char **argv){ | |||
127 | if (spclose(child_process)) { | 130 | if (spclose(child_process)) { |
128 | result=error_set(result,STATE_WARNING); | 131 | result=error_set(result,STATE_WARNING); |
129 | if (!strcmp(output,"")) | 132 | if (!strcmp(output,"")) |
130 | strcpy(output,"nslookup returned error status"); | 133 | strcpy(output,"nslookup returned an error status"); |
131 | } | 134 | } |
132 | 135 | ||
133 | (void)time(&end_time); | 136 | (void)time(&end_time); |
@@ -144,6 +147,8 @@ int main(int argc, char **argv){ | |||
144 | return result; | 147 | return result; |
145 | } | 148 | } |
146 | 149 | ||
150 | |||
151 | |||
147 | /* reverse the ipaddr */ | 152 | /* reverse the ipaddr */ |
148 | char *reverse_ipaddr(char *ipaddr) | 153 | char *reverse_ipaddr(char *ipaddr) |
149 | { | 154 | { |
@@ -160,6 +165,7 @@ char *reverse_ipaddr(char *ipaddr) | |||
160 | } | 165 | } |
161 | 166 | ||
162 | 167 | ||
168 | |||
163 | /* process command-line arguments */ | 169 | /* process command-line arguments */ |
164 | int process_arguments(int argc, char **argv) | 170 | int process_arguments(int argc, char **argv) |
165 | { | 171 | { |
@@ -189,9 +195,6 @@ int process_arguments(int argc, char **argv) | |||
189 | 195 | ||
190 | 196 | ||
191 | 197 | ||
192 | |||
193 | |||
194 | |||
195 | int call_getopt(int argc, char **argv) | 198 | int call_getopt(int argc, char **argv) |
196 | { | 199 | { |
197 | int c,i=0; | 200 | int c,i=0; |
@@ -266,7 +269,9 @@ int call_getopt(int argc, char **argv) | |||
266 | print_help(); | 269 | print_help(); |
267 | exit(STATE_OK); | 270 | exit(STATE_OK); |
268 | case '?': /* help */ | 271 | case '?': /* help */ |
269 | usage("Invalid argument\n"); | 272 | printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); |
273 | print_usage (); | ||
274 | exit (STATE_UNKNOWN); | ||
270 | } | 275 | } |
271 | } | 276 | } |
272 | return i; | 277 | return i; |
@@ -274,8 +279,6 @@ int call_getopt(int argc, char **argv) | |||
274 | 279 | ||
275 | 280 | ||
276 | 281 | ||
277 | |||
278 | |||
279 | int validate_arguments(void) | 282 | int validate_arguments(void) |
280 | { | 283 | { |
281 | if (query_address == NULL || rbl_name == NULL) | 284 | if (query_address == NULL || rbl_name == NULL) |
@@ -286,8 +289,6 @@ int validate_arguments(void) | |||
286 | 289 | ||
287 | 290 | ||
288 | 291 | ||
289 | |||
290 | |||
291 | void print_help(void) | 292 | void print_help(void) |
292 | { | 293 | { |
293 | print_revision(progname,"$Revision$"); | 294 | print_revision(progname,"$Revision$"); |
@@ -317,8 +318,6 @@ void print_help(void) | |||
317 | 318 | ||
318 | 319 | ||
319 | 320 | ||
320 | |||
321 | |||
322 | void print_usage(void) | 321 | void print_usage(void) |
323 | { | 322 | { |
324 | printf | 323 | printf |