liminix/pkgs/anoia/init.fnl
Daniel Barlow 353a199ab2 odhcpc script: parse ADDRESSES and PREFIXES
so downstream doesn't have to
2023-09-05 22:42:25 +01:00

19 lines
425 B
Fennel

(fn merge [table1 table2]
(collect [k v (pairs table2) &into table1]
k v))
(fn split [sep string]
(icollect [v (string.gmatch string (.. "([^" sep "]+)"))]
v))
(fn file-exists? [name]
(match (io.open name :r)
f (do (f:close) true)
_ false))
(fn system [s] (assert (os.execute s)))
(fn mkdir [directory]
(os.execute (.. "mkdir -p " directory)))
{ : merge : split : file-exists? : system : mkdir }