forked from DGNum/liminix
remove file-scoped parameters var
This commit is contained in:
parent
cbd3dfefc5
commit
ffe9603c39
1 changed files with 14 additions and 15 deletions
|
@ -14,33 +14,32 @@
|
||||||
[linkname nil] {:link linkname :expecting "present"}
|
[linkname nil] {:link linkname :expecting "present"}
|
||||||
_ nil))
|
_ nil))
|
||||||
|
|
||||||
(local parameters
|
(fn run-event [params v]
|
||||||
(or
|
|
||||||
(parse-args arg)
|
|
||||||
(assert false (.. "Usage: " (. arg 0) " [-v] ifname [present|up|running]"))))
|
|
||||||
|
|
||||||
(fn run-event [v]
|
|
||||||
(let [got
|
(let [got
|
||||||
(match v
|
(match v
|
||||||
;; - up: Reflects the administrative state of the interface (IFF_UP)
|
;; - up: Reflects the administrative state of the interface (IFF_UP)
|
||||||
;; - running: Reflects the operational state (IFF_RUNNING).
|
;; - running: Reflects the operational state (IFF_RUNNING).
|
||||||
{:event "newlink" :name parameters.link :up :yes :running :yes}
|
{:event "newlink" :name params.link :up :yes :running :yes}
|
||||||
{:present true :up true :running true}
|
{:present true :up true :running true}
|
||||||
|
|
||||||
{:event "newlink" :name parameters.link :up :yes}
|
{:event "newlink" :name params.link :up :yes}
|
||||||
{:present :true :up true}
|
{:present :true :up true}
|
||||||
|
|
||||||
{:event "newlink" :name parameters.link}
|
{:event "newlink" :name params.link}
|
||||||
{:present true }
|
{:present true }
|
||||||
|
|
||||||
_
|
_
|
||||||
{})]
|
{})]
|
||||||
(when (. got parameters.expecting)
|
(when (. got params.expecting)
|
||||||
(os.exit 0))))
|
(os.exit 0))))
|
||||||
|
|
||||||
(when parameters.verbose
|
(let [parameters
|
||||||
(print (.. (. arg 0) ": waiting for "
|
(or
|
||||||
parameters.link " to be " parameters.expecting)))
|
(parse-args arg)
|
||||||
|
(assert false (.. "Usage: " (. arg 0) " [-v] ifname [present|up|running]")))]
|
||||||
|
(when parameters.verbose
|
||||||
|
(print (.. (. arg 0) ": waiting for "
|
||||||
|
parameters.link " to be " parameters.expecting)))
|
||||||
|
|
||||||
(each [event (nl.events {:link true})]
|
(each [event (nl.events {:link true})]
|
||||||
(run-event event))
|
(run-event parameters event)))
|
||||||
|
|
Loading…
Reference in a new issue