diff options
author | dvs1 | 2024-10-24 12:33:52 +1000 |
---|---|---|
committer | dvs1 | 2024-10-24 12:33:52 +1000 |
commit | f6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1 (patch) | |
tree | db5e108763d5509e312de60426f35e16660277c4 | |
parent | Introducing PolygLua, writing Lua in any language. (diff) | |
download | JackOnAllDevices-f6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1.zip JackOnAllDevices-f6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1.tar.gz JackOnAllDevices-f6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1.tar.bz2 JackOnAllDevices-f6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1.tar.xz |
Add an after command for forked stuff, to be called whan the forked thing ends.
-rwxr-xr-x | _.lua | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -213,9 +213,12 @@ __ = function(c) | |||
213 | return self | 213 | return self |
214 | end | 214 | end |
215 | 215 | ||
216 | function exe:fork(host) | 216 | function exe:fork(after, host) |
217 | -- The host part is from apt-panopticon, likely needed there, but makes no sense here. | ||
217 | -- if nil ~= host then self.cmd = self.cmd .. '; r=$?; if [ $r -ge 124 ]; then echo "$r ' .. host .. ' failed forked command ' .. string.gsub(self.cmd, '"', "'") .. '"; fi' end | 218 | -- if nil ~= host then self.cmd = self.cmd .. '; r=$?; if [ $r -ge 124 ]; then echo "$r ' .. host .. ' failed forked command ' .. string.gsub(self.cmd, '"', "'") .. '"; fi' end |
218 | self.cmd = '{ ' .. self.cmd .. ' ; } & ' | 219 | if nil == after then after = '' end |
220 | if '' ~= after then after = ' ; ' .. after end | ||
221 | self.cmd = '{ ' .. self.cmd .. after .. ' ; } & ' | ||
219 | if true == self.logging then D(" forking - " .. self.cmd) end | 222 | if true == self.logging then D(" forking - " .. self.cmd) end |
220 | os.execute(self.cmd) | 223 | os.execute(self.cmd) |
221 | return self | 224 | return self |