summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2016-01-14 17:05:16 +0000
committerRoy Marples <roy@marples.name>2016-01-14 17:05:16 +0000
commitdf57499917d220a9ef834c372ee499d6d6d012c2 (patch)
tree8d0d7cfec3caa06ef59644348d7d4fc544074f40 /dhcpcd.c
parent75c82b879f48123e454b40302a0a283e5dbbfa6c (diff)
downloaddhcpcd-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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 0edc2446..5ca9f321 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -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))