diff options
| author | Roy Marples <roy@marples.name> | 2016-01-14 17:05:16 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-01-14 17:05:16 +0000 |
| commit | df57499917d220a9ef834c372ee499d6d6d012c2 (patch) | |
| tree | 8d0d7cfec3caa06ef59644348d7d4fc544074f40 /dhcpcd.c | |
| parent | 75c82b879f48123e454b40302a0a283e5dbbfa6c (diff) | |
| download | dhcpcd-df57499917d220a9ef834c372ee499d6d6d012c2.tar.xz | |
Add the -1, --oneshot option which causes dhcpcd to exit once an
interface has been configured.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -318,6 +318,12 @@ dhcpcd_daemonise(struct dhcpcd_ctx *ctx) return 0; } + if (ctx->options & DHCPCD_ONESHOT) { + logger(ctx, LOG_INFO, "exiting due to oneshot"); + eloop_exit(ctx->eloop, EXIT_SUCCESS); + return 0; + } + eloop_timeout_delete(ctx->eloop, handle_exit_timeout, ctx); if (ctx->options & DHCPCD_DAEMONISED || !(ctx->options & DHCPCD_DAEMONISE)) |
