At the moment, I have this in a wrapper script:
2>&1 ./update.sh | ts | tee -a ./update.log
and this in update.sh:
if apt full-upgrade -y | grep linux-headers
then
echo
echo Need to Fix the Capture Driver!
fi
(there's some additional logic to fix the driver automatically, but I think you get the idea)
It works, except that I don't get the full output of apt full-upgrade in the terminal or in the logfile. I only get what grep matches.
I could probably tee the full output of apt full-upgrade to a temp file, before the if, and then grep and rm the temp file, but is there a better way than that to get a complete terminal and log, and keep the logic?