Code

Bump plugins-root/ to GPLv3
[nagiosplug.git] / plugins-root / check_dhcp.c
index c6e5af8ab7aed93828f49933a1716ca4c638b73e..a41a86e9ed14b37d46a6b34c37bf15cf12e57c08 100644 (file)
@@ -1,49 +1,44 @@
-/******************************************************************************
-*
+/*****************************************************************************
+* 
 * Nagios check_dhcp plugin
-*
+* 
 * License: GPL
 * Copyright (c) 2001-2004 Ethan Galstad (nagios@nagios.org)
-* Copyright (c) 2001-2006 Nagios Plugin Development Team
-*
+* Copyright (c) 2001-2007 Nagios Plugin Development Team
+* 
 * Last Modified: $Date$
-*
+* 
 * Description:
-*
+* 
 * This file contains the check_dhcp plugin
-*
-*  This plugin tests the availability of DHCP servers on a network.
-*
-*
-* License Information:
-*
-* This program is free software; you can redistribute it and/or modify
+* 
+* This plugin tests the availability of DHCP servers on a network.
+* 
+* Unicast mode was originally implemented by Heiti of Boras Kommun with
+* general improvements as well as usability fixes and "forward"-porting by
+* Andreas Ericsson of OP5 AB.
+* 
+* 
+* This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
+* the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
-*
+* 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
-*
+* 
 * You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
+* along with this program.  If not, see <http://www.gnu.org/licenses/>.
+* 
 * $Id$
-*
-* ------------------------------------------------------------------------
-* Unicast mode was originally implemented by Heiti of Boras Kommun with
-* general improvements as well as usability fixes and "forward"-porting by
-* Andreas Ericsson of OP5 AB.
-* ------------------------------------------------------------------------
-*
+* 
 *****************************************************************************/
 
 const char *progname = "check_dhcp";
 const char *revision = "$Revision$";
-const char *copyright = "2001-2006";
+const char *copyright = "2001-2007";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
 #include "common.h"
@@ -269,9 +264,6 @@ int main(int argc, char **argv){
        int dhcp_socket;
        int result = STATE_UNKNOWN;
 
-       /* this plugin almost certainly needs root permissions. */
-       np_warn_if_not_root();
-       
        setlocale (LC_ALL, "");
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
@@ -280,6 +272,9 @@ int main(int argc, char **argv){
                usage4 (_("Could not parse arguments"));
                }
 
+       /* this plugin almost certainly needs root permissions. */
+       np_warn_if_not_root();
+       
        /* create socket for DHCP communications */
        dhcp_socket=create_dhcp_socket();