forked from DGNum/liminix
dhcpc6 scripts: simplify (and improve correctness)
This commit is contained in:
parent
28fe37d555
commit
4bcc3d5b28
4 changed files with 138 additions and 92 deletions
|
@ -30,17 +30,11 @@
|
|||
(each [_ a (ipairs (split " " addresses))]
|
||||
(let [address (parse-address a)
|
||||
suffix (base64url (string.pack "n" (hash a)))
|
||||
;; keydir should be a function of all the address
|
||||
;; attributes: we want it to change whenever anything changes
|
||||
;; so that clients can see which addresses are new without
|
||||
;; deep table comparisons
|
||||
keydir (..
|
||||
prefix
|
||||
(-> address.address
|
||||
(: :gsub "::$" "")
|
||||
(: :gsub ":" "-"))
|
||||
"_"
|
||||
suffix)]
|
||||
(: :gsub ":" "-")))]
|
||||
(mktree (.. state-directory "/" keydir))
|
||||
(each [k v (pairs address)]
|
||||
(write-value (.. keydir "/" k) v)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue