aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordvs12024-10-24 12:33:52 +1000
committerdvs12024-10-24 12:33:52 +1000
commitf6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1 (patch)
treedb5e108763d5509e312de60426f35e16660277c4
parentIntroducing PolygLua, writing Lua in any language. (diff)
downloadJackOnAllDevices-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_.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/_.lua b/_.lua
index e3e6a82..b86eda0 100755
--- a/_.lua
+++ b/_.lua
@@ -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