
Originally Posted by
Raxje
Hi,
(note: none of the previous echo's were produced).
yes, and that tells you what the problem is, doesn't it ?
you have
Code:
sudo apt-get -y dist-upgrade >> /home/autopatch/patch_notes \
&& echo "Patching complete - Checking for Kernel update.."
You know that '&&' only runs the 2nd statement after the 1st has completed successfully, right ?
so the absence of that echo tells your 'sudo apt-get ...' did not exit with a 0 error code.
You should trap errors there (rather than report on success only) and have your script react to them, eg. complain and exit, because your subsequent statements don't make much sense (and are potentially dangerous) if the dist-upgrade failed. Rebooting with a half-installed kernel, for instance, is not a good idea.
Bookmarks