2022-09-02 16:05:16 -05:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
n=0
|
|
|
|
max=2
|
|
|
|
until [ $n -gt $max ]; do
|
2022-09-05 18:43:24 -05:00
|
|
|
set +e
|
|
|
|
(
|
|
|
|
apt-get update -qq &&
|
|
|
|
apt-get install -y --no-install-recommends "$@"
|
|
|
|
)
|
|
|
|
CODE=$?
|
|
|
|
set -e
|
|
|
|
if [ $CODE -eq 0 ]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
if [ $n -eq $max ]; then
|
|
|
|
exit $CODE
|
|
|
|
fi
|
|
|
|
echo "apt failed, retrying"
|
|
|
|
n=$((n + 1))
|
2022-09-02 16:05:16 -05:00
|
|
|
done
|
|
|
|
rm -r /var/lib/apt/lists /var/cache/apt/archives
|