odhcp-script only write addresses if there are any

This commit is contained in:
Daniel Barlow 2023-09-13 17:51:07 +01:00
parent b3e505abf4
commit 106a429b3d

View file

@ -85,8 +85,8 @@
(each [_ n (ipairs wanted)] (each [_ n (ipairs wanted)]
(write-value-from-env n)) (write-value-from-env n))
(write-addresses "address/" (os.getenv :ADDRESSES)) (match (os.getenv :ADDRESSES) s (write-addresses "address/" s))
(write-addresses "prefix/" (os.getenv :PREFIXES))) (match (os.getenv :PREFIXES) s (write-addresses "prefix/" s)))
(let [[ifname state] arg (let [[ifname state] arg
ready (match state ready (match state