liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fa040a194c0ed7d9fc3f58d46ac229189ae9d959
parent 3bdb7754d3e4734ffbd105c88801ed8a7bcb901b
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 13 Sep 2023 13:17:58 +0100

acquire-wan-address remove boundness checking

if we're unbound then the script will be called with
empty ADDRESSES and so the usual case will handle this fine
by removing all the previosuly set addresses

Diffstat:
Mexamples/acquire-wan-address.fnl | 13+------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/examples/acquire-wan-address.fnl b/examples/acquire-wan-address.fnl @@ -1,14 +1,6 @@ (local { : system } (require :anoia)) (local svc (require :anoia.svc)) -(local bound-states - { :bound true - :rebound true - :informed true - :updated true - :ra-updated true - }) - (fn changes [old-addresses new-addresses] (let [added {} deleted {}] @@ -35,9 +27,6 @@ dir (svc.open state-directory)] (accumulate [addresses [] v (dir:events)] - ;; we don't handle unbound or stopped, where we should - ;; take the addresses away - (when (. bound-states (v:output "state")) - (update-addresses wan-device addresses (v:output "address")))))) + (update-addresses wan-device addresses (v:output "address"))))) { : update-addresses : changes : run }