mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-30 13:57:50 +00:00
Support environment variables to control locations of files.
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
static char ocopyright[] =
|
||||||
"$Id: dhclient.c,v 1.106 2000/06/24 06:02:01 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhclient.c,v 1.107 2000/07/17 20:56:11 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -104,6 +104,10 @@ int main (argc, argv, envp)
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
int persist = 0;
|
int persist = 0;
|
||||||
int omapi_port;
|
int omapi_port;
|
||||||
|
int no_dhclient_conf = 0;
|
||||||
|
int no_dhclient_db = 0;
|
||||||
|
int no_dhclient_pid = 0;
|
||||||
|
char *s;
|
||||||
|
|
||||||
#ifdef SYSLOG_4_2
|
#ifdef SYSLOG_4_2
|
||||||
openlog ("dhclient", LOG_NDELAY);
|
openlog ("dhclient", LOG_NDELAY);
|
||||||
@@ -147,14 +151,17 @@ int main (argc, argv, envp)
|
|||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
path_dhclient_pid = argv [i];
|
path_dhclient_pid = argv [i];
|
||||||
|
no_dhclient_pid = 1;
|
||||||
} else if (!strcmp (argv [i], "-cf")) {
|
} else if (!strcmp (argv [i], "-cf")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
path_dhclient_conf = argv [i];
|
path_dhclient_conf = argv [i];
|
||||||
|
no_dhclient_conf = 1;
|
||||||
} else if (!strcmp (argv [i], "-lf")) {
|
} else if (!strcmp (argv [i], "-lf")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
path_dhclient_db = argv [i];
|
path_dhclient_db = argv [i];
|
||||||
|
no_dhclient_db = 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;
|
||||||
@@ -195,6 +202,16 @@ int main (argc, argv, envp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!no_dhclient_conf && (s = getenv ("PATH_DHCLIENT_CONF"))) {
|
||||||
|
path_dhclient_conf = s;
|
||||||
|
}
|
||||||
|
if (!no_dhclient_db && (s = getenv ("PATH_DHCLIENT_DB"))) {
|
||||||
|
path_dhclient_db = s;
|
||||||
|
}
|
||||||
|
if (!no_dhclient_pid && (s = getenv ("PATH_DHCLIENT_PID"))) {
|
||||||
|
path_dhclient_pid = s;
|
||||||
|
}
|
||||||
|
|
||||||
/* first kill of any currently running client */
|
/* first kill of any currently running client */
|
||||||
if (release_mode) {
|
if (release_mode) {
|
||||||
/* XXX inelegant hack to prove concept */
|
/* XXX inelegant hack to prove concept */
|
||||||
@@ -2168,6 +2185,7 @@ void script_write_params (client, prefix, lease)
|
|||||||
struct data_string data;
|
struct data_string data;
|
||||||
struct option_cache *oc;
|
struct option_cache *oc;
|
||||||
pair *hash;
|
pair *hash;
|
||||||
|
char *s, *t;
|
||||||
|
|
||||||
fprintf (scriptFile, "%sip_address=\"%s\"\n",
|
fprintf (scriptFile, "%sip_address=\"%s\"\n",
|
||||||
prefix, piaddr (lease -> address));
|
prefix, piaddr (lease -> address));
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
static char ocopyright[] =
|
||||||
"$Id: dhcrelay.c,v 1.41 2000/05/16 23:03:30 mellon Exp $ Copyright (c) 1997-2000 Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhcrelay.c,v 1.42 2000/07/17 20:56:14 mellon Exp $ Copyright (c) 1997-2000 Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -124,6 +124,7 @@ int main (argc, argv, envp)
|
|||||||
int no_daemon = 0;
|
int no_daemon = 0;
|
||||||
int quiet = 0;
|
int quiet = 0;
|
||||||
isc_result_t status;
|
isc_result_t status;
|
||||||
|
char *s;
|
||||||
|
|
||||||
#ifdef SYSLOG_4_2
|
#ifdef SYSLOG_4_2
|
||||||
openlog ("dhcrelay", LOG_NDELAY);
|
openlog ("dhcrelay", LOG_NDELAY);
|
||||||
@@ -214,6 +215,10 @@ int main (argc, argv, envp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((s = getenv ("PATH_DHCRELAY_PID"))) {
|
||||||
|
path_dhcrelay_pid = s;
|
||||||
|
}
|
||||||
|
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
log_info ("%s %s", message, DHCP_VERSION);
|
log_info ("%s %s", message, DHCP_VERSION);
|
||||||
log_info (copyright);
|
log_info (copyright);
|
||||||
|
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
static char ocopyright[] =
|
||||||
"$Id: dhcpd.c,v 1.95 2000/07/06 10:22:50 mellon Exp $ Copyright 1995-2000 Internet Software Consortium.";
|
"$Id: dhcpd.c,v 1.96 2000/07/17 20:56:08 mellon Exp $ Copyright 1995-2000 Internet Software Consortium.";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
@@ -166,6 +166,9 @@ int main (argc, argv, envp)
|
|||||||
struct parse *parse;
|
struct parse *parse;
|
||||||
int lose;
|
int lose;
|
||||||
int omapi_port;
|
int omapi_port;
|
||||||
|
int no_dhcpd_conf = 0;
|
||||||
|
int no_dhcpd_db = 0;
|
||||||
|
int no_dhcpd_pid = 0;
|
||||||
|
|
||||||
/* Set up the client classification system. */
|
/* Set up the client classification system. */
|
||||||
classification_setup ();
|
classification_setup ();
|
||||||
@@ -221,14 +224,17 @@ int main (argc, argv, envp)
|
|||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
path_dhcpd_conf = argv [i];
|
path_dhcpd_conf = argv [i];
|
||||||
|
no_dhcpd_conf = 1;
|
||||||
} else if (!strcmp (argv [i], "-lf")) {
|
} else if (!strcmp (argv [i], "-lf")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
path_dhcpd_db = argv [i];
|
path_dhcpd_db = argv [i];
|
||||||
|
no_dhcpd_db = 1;
|
||||||
} else if (!strcmp (argv [i], "-pf")) {
|
} else if (!strcmp (argv [i], "-pf")) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage ();
|
||||||
path_dhcpd_pid = argv [i];
|
path_dhcpd_pid = argv [i];
|
||||||
|
no_dhcpd_pid = 1;
|
||||||
} else if (!strcmp (argv [i], "-t")) {
|
} else if (!strcmp (argv [i], "-t")) {
|
||||||
/* test configurations only */
|
/* test configurations only */
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
@@ -268,6 +274,16 @@ int main (argc, argv, envp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!no_dhcpd_conf && (s = getenv ("PATH_DHCPD_CONF"))) {
|
||||||
|
path_dhcpd_conf = s;
|
||||||
|
}
|
||||||
|
if (!no_dhcpd_db && (s = getenv ("PATH_DHCPD_DB"))) {
|
||||||
|
path_dhcpd_db = s;
|
||||||
|
}
|
||||||
|
if (!no_dhcpd_pid && (s = getenv ("PATH_DHCPD_PID"))) {
|
||||||
|
path_dhcpd_pid = s;
|
||||||
|
}
|
||||||
|
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
log_info ("%s %s", message, DHCP_VERSION);
|
log_info ("%s %s", message, DHCP_VERSION);
|
||||||
log_info (copyright);
|
log_info (copyright);
|
||||||
|
Reference in New Issue
Block a user