1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #!/bin/execlineb
- # execline is used for `piperw`, there is nothing similar in posix shell
- elgetopt "l:c:s:"
- multisubstitute {
- importas -ui LIVE ELGETOPT_l
- importas -ui COMPILED ELGETOPT_c
- importas -ui SVDIR ELGETOPT_s
- }
- fdreserve 2
- multisubstitute
- {
- importas -ui fdr FD0
- importas -ui fdw FD1
- }
- piperw "${fdr}" "${fdw}"
- getpid -E ppid
- background {
- fdclose "${fdw}"
- fdmove 0 "${fdr}"
- withstdinas -NE __new_line
- ifelse {
- ifelse { test -d "${LIVE}" }
- { # then
- s6-rc-update -l "${LIVE}" "${COMPILED}"
- } # else
- s6-rc-init -l "${LIVE}" -c "${COMPILED}" "${SVDIR}"
- } { # then
- s6-rc -l "${LIVE}" -up change default
- } # else
- kill "${ppid}"
- }
- fdclose "${fdr}"
- s6-svscan -d "${fdw}" -- "${SVDIR}"
|