commit 06d28e9b0847dbac195ec7a0a88b96c3e21e344c
parent 9540fc264191afdf7719a56f054d127c02674b20
Author: Daniel Barlow <dan@telent.net>
Date: Sat, 15 Jun 2024 15:34:49 +0100
dhcpc handle case when env vars are missing
the notify-script should continue and signal readiness even if one or
more of the outputs it writes are mssing in the environment
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/network/dhcpc.nix b/modules/network/dhcpc.nix
@@ -17,7 +17,7 @@ let
ip address replace $ip/$mask dev $interface
(in_outputs ${name}
for i in lease mask ip router siaddr dns serverid subnet opt53 interface ; do
- printenv $i > $i
+ (printenv $i || true) > $i
done)
}
case $action in
@@ -40,7 +40,7 @@ let
'';
in longrun {
inherit name;
- run = "/bin/udhcpc -f -i $(output ${interface} ifname) -x hostname:$(cat /proc/sys/kernel/hostname) -s ${script}";
+ run = "exec /bin/udhcpc -f -i $(output ${interface} ifname) -x hostname:$(cat /proc/sys/kernel/hostname) -s ${script}";
notification-fd = 10;
dependencies = [ interface ];
}