Code

initial merging of ae's np_runcmd code into selected plugins.
[nagiosplug.git] / plugins / netutils.c
index db64ef09b230dcf1a106e6ec3eff6a34b1c5b5da..082452768642e7a7bb7673af9130dddaec8801be 100644 (file)
@@ -291,6 +291,13 @@ is_host (const char *address)
        return (FALSE);
 }
 
+void
+host_or_die(const char *str)
+{
+       if(!str || (!is_addr(str) && !is_hostname(str)))
+               usage_va(_("Invalid hostname/address - %s"), str);
+}
+
 int
 is_addr (const char *address)
 {