From f6cbb3e29d7e6a73b8ff528c2a329b12c6a706b1 Mon Sep 17 00:00:00 2001 From: dvs1 Date: Thu, 24 Oct 2024 12:33:52 +1000 Subject: Add an after command for forked stuff, to be called whan the forked thing ends. --- _.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to '_.lua') diff --git a/_.lua b/_.lua index e3e6a82..b86eda0 100755 --- a/_.lua +++ b/_.lua @@ -213,9 +213,12 @@ __ = function(c) return self end - function exe:fork(host) + function exe:fork(after, host) +-- The host part is from apt-panopticon, likely needed there, but makes no sense here. -- 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 - self.cmd = '{ ' .. self.cmd .. ' ; } & ' + if nil == after then after = '' end + if '' ~= after then after = ' ; ' .. after end + self.cmd = '{ ' .. self.cmd .. after .. ' ; } & ' if true == self.logging then D(" forking - " .. self.cmd) end os.execute(self.cmd) return self -- cgit v1.1