Allow interface to also be a path to a DHCP wire formatted file.

This commit is contained in:
Roy Marples 2010-08-24 10:36:20 +00:00
parent 0e07d2a3e5
commit cb90edf46f
2 changed files with 7 additions and 0 deletions

View File

@ -495,6 +495,8 @@ before starting
Dumps the last lease for the
.Ar interface
to stdout.
.Ar interface
could also be a path to a DHCP wire formatted file.
.It Fl V, -variables
Display a list of option codes and the associated variable for use in
.Xr dhcpcd-run-hooks 8 .

View File

@ -1780,6 +1780,11 @@ main(int argc, char **argv)
strlcpy(iface->state->options->script, if_options->script,
sizeof(iface->state->options->script));
iface->state->new = read_lease(iface);
if (iface->state->new == NULL && errno == ENOENT) {
strlcpy(iface->leasefile, argv[optind],
sizeof(iface->leasefile));
iface->state->new = read_lease(iface);
}
if (iface->state->new == NULL) {
if (errno == ENOENT)
syslog(LOG_ERR, "%s: no lease to dump",