mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 07:15:44 +00:00
Implement -T flag.
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
static char ocopyright[] =
|
||||||
"$Id: dhcpd.c,v 1.73 1999/09/09 21:11:27 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
|
"$Id: dhcpd.c,v 1.74 1999/10/01 03:26:01 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
@@ -69,6 +69,7 @@ int main (argc, argv, envp)
|
|||||||
struct servent *ent;
|
struct servent *ent;
|
||||||
char *s;
|
char *s;
|
||||||
int cftest = 0;
|
int cftest = 0;
|
||||||
|
int lftest = 0;
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
int pidfilewritten = 0;
|
int pidfilewritten = 0;
|
||||||
int pid;
|
int pid;
|
||||||
@@ -145,6 +146,14 @@ int main (argc, argv, envp)
|
|||||||
#endif
|
#endif
|
||||||
cftest = 1;
|
cftest = 1;
|
||||||
log_perror = -1;
|
log_perror = -1;
|
||||||
|
} else if (!strcmp (argv [i], "-T")) {
|
||||||
|
/* test configurations and lease file only */
|
||||||
|
#ifndef DEBUG
|
||||||
|
daemon = 0;
|
||||||
|
#endif
|
||||||
|
cftest = 1;
|
||||||
|
lftest = 1;
|
||||||
|
log_perror = -1;
|
||||||
} else if (!strcmp (argv [i], "-q")) {
|
} else if (!strcmp (argv [i], "-q")) {
|
||||||
quiet = 1;
|
quiet = 1;
|
||||||
quiet_interface_discovery = 1;
|
quiet_interface_discovery = 1;
|
||||||
@@ -225,15 +234,18 @@ int main (argc, argv, envp)
|
|||||||
dhcp_db_objects_setup ();
|
dhcp_db_objects_setup ();
|
||||||
|
|
||||||
/* Read the dhcpd.conf file... */
|
/* Read the dhcpd.conf file... */
|
||||||
if (!readconf ())
|
if (readconf () != ISC_R_SUCCESS)
|
||||||
log_fatal ("Configuration file errors encountered -- exiting");
|
log_fatal ("Configuration file errors encountered -- exiting");
|
||||||
|
|
||||||
/* test option should cause an early exit */
|
/* test option should cause an early exit */
|
||||||
if (cftest)
|
if (cftest && !lftest)
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
/* Start up the database... */
|
/* Start up the database... */
|
||||||
db_startup ();
|
db_startup (lftest);
|
||||||
|
|
||||||
|
if (lftest)
|
||||||
|
exit (0);
|
||||||
|
|
||||||
/* Discover all the network interfaces and initialize them. */
|
/* Discover all the network interfaces and initialize them. */
|
||||||
discover_interfaces (DISCOVER_SERVER);
|
discover_interfaces (DISCOVER_SERVER);
|
||||||
|
Reference in New Issue
Block a user