From fa7e682e87963ffc4560bf792ecd469efd13e132 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 26 May 2023 18:36:44 +0100 Subject: [PATCH] dhcp6c readiness notification --- examples/rotuer.nix | 1 + examples/udhcp6-script.fnl | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/examples/rotuer.nix b/examples/rotuer.nix index b715da6..c19301c 100644 --- a/examples/rotuer.nix +++ b/examples/rotuer.nix @@ -244,6 +244,7 @@ in rec { ''; in longrun { inherit name; + notification-fd = 10; run = '' ${pkgs.odhcp6c}/bin/odhcp6c -s ${script} -e -v -p /run/${name}.pid -P 48 $(output ${services.wan} ifname) ) diff --git a/examples/udhcp6-script.fnl b/examples/udhcp6-script.fnl index f7d2b37..cd1c287 100644 --- a/examples/udhcp6-script.fnl +++ b/examples/udhcp6-script.fnl @@ -45,3 +45,11 @@ ]] (each [_ n (ipairs wanted)] (write-value-from-env n))) + +(let [ready (match state + "started" false + "unbound" false + "stopped" false + _ true)] + (and ready + (with-open [fd (io.open "/proc/self/fd/10" :w)] (fd:write "\n"))))