This commit is contained in:
Alexandre
2022-01-20 21:19:51 +01:00
parent 3072b45533
commit 73a4d2b5ff

View File

@@ -134,23 +134,23 @@ done
# Install apps
[ "$VERBOSE" = true ] && echo "installing packages $PACKAGES"
[ "$PACKMANAGER" = "apt" ] && apt-get update >/dev/null || true
if [ "$PACKMANAGER" = "apt" ]; then apt-get update >/dev/null; fi
# Install apps one by one to allow failures
ERROR=0
for packagestoinstall in $PACKAGES; do
[ "$VERBOSE" = true ] && echo "... $packagestoinstall"
if [ "$PACKMANAGER" = "apk" ]; then
apk add --no-cache $packagestoinstall &>/dev/null || (echo "Error : $packagestoinstall not found" && ERROR=1)
apk add --no-cache "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR)
elif [ "$PACKMANAGER" = "apt" ]; then
apt-get install -yqq --no-install-recommends $packagestoinstall &>/dev/null || (echo "Error : $packagestoinstall not found" && ERROR=1)
apt-get install -yqq --no-install-recommends "$packagestoinstall" &>/dev/null || (echo "Error : $packagestoinstall not found" && touch /ERROR)
fi
[ "$VERBOSE" = true ] && echo "... $packagestoinstall done"
done
# Clean after install
[ "$VERBOSE" = true ] && echo "Cleaning apt cache"
[ "$PACKMANAGER" = "apt" ] && apt-get clean >/dev/null || true
if [ "$PACKMANAGER" = "apt" ]; then apt-get clean >/dev/null; fi
# Replace nginx if installed
if ls /etc/nginx2 1>/dev/null 2>&1; then
@@ -213,6 +213,6 @@ for files in "/scripts" "/etc/services.d" "/etc/cont-init.d"; do
done
if [ $ERROR = 1 ]; then
if [ -f /ERROR ]; then
exit 1
fi