Logging the error code reset it (as echo executed successfully), so save it first. Also check for the failure of the second attempt to run apt too.
Logging the error code reset it (as echo executed successfully), so save it first. Also check for the failure of the second attempt to run apt too.