no need to mess with set -e/set +e, because the return code of apt-get
is shadowed by `tee` (unless -o pipefail is used, which is not the case
here).
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
local RESULT=$(egrep 'Failed to fetch.*(Unable to connect to|Connection failed|Size mismatch|Cannot initiate the connection to|Bad Gateway|Service Unavailable)'$TMPLOG||true)
set-e
if[!-z"$RESULT"];then
if[!-z"$RESULT"]||["${PIPESTATUS[0]}"-ne 0 ];then
echo"$(date-u) - 'apt-get $@' failed, sleeping 5min before retrying..."