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
This commit is contained in:
Daniel Barlow 2024-06-15 15:34:49 +01:00
parent 9540fc2641
commit 06d28e9b08
1 changed files with 2 additions and 2 deletions

View File

@ -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 ];
}