forked from dan/liminix
skip symlink handing unless linkname was provided
This commit is contained in:
parent
898958fa10
commit
af9200a136
@ -17,13 +17,13 @@
|
|||||||
(var up :unknown)
|
(var up :unknown)
|
||||||
|
|
||||||
(fn start-service [devname linkname service]
|
(fn start-service [devname linkname service]
|
||||||
(match (symlink (.. "/dev/" devname ) linkname)
|
(match (if linkname (symlink (.. "/dev/" devname) linkname) true)
|
||||||
ok (pcall system (%% "s6-rc -b -u change %q" service))
|
ok (pcall system (%% "s6-rc -b -u change %q" service))
|
||||||
(nil err) false))
|
(nil err) false))
|
||||||
|
|
||||||
(fn stop-service [linkname service]
|
(fn stop-service [linkname service]
|
||||||
(match (pcall system (%% "s6-rc -b -d change %q" linkname service))
|
(match (pcall system (%% "s6-rc -b -d change %q" service))
|
||||||
ok (os.remove linkname)
|
ok (if linkname (os.remove linkname) true)
|
||||||
(nil err) false))
|
(nil err) false))
|
||||||
|
|
||||||
(fn toggle-service [devname linkname service wanted?]
|
(fn toggle-service [devname linkname service wanted?]
|
||||||
@ -45,7 +45,7 @@
|
|||||||
(set up :unknown)
|
(set up :unknown)
|
||||||
(let [parameters
|
(let [parameters
|
||||||
(assert (parse-args args) (.. "can't parse args: " (table.concat args " ")))]
|
(assert (parse-args args) (.. "can't parse args: " (table.concat args " ")))]
|
||||||
(mktree (dirname parameters.linkname))
|
(when parameters.linkname (mktree (dirname parameters.linkname)))
|
||||||
(var finished? false)
|
(var finished? false)
|
||||||
|
|
||||||
(print "registering for events" (fh:write parameters.matches))
|
(print "registering for events" (fh:write parameters.matches))
|
||||||
|
Loading…
Reference in New Issue
Block a user