mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 22:04:06 +02:00
Allow exit 1
This commit is contained in:
@@ -11,7 +11,7 @@ set +u 2>/dev/null || true
|
|||||||
#If no packages, empty
|
#If no packages, empty
|
||||||
PACKAGES="${*:-}"
|
PACKAGES="${*:-}"
|
||||||
#Avoids messages if non interactive
|
#Avoids messages if non interactive
|
||||||
(echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections) || true
|
(echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections) >/dev/null || true
|
||||||
|
|
||||||
[ "$VERBOSE" = true ] && echo "ENV : $PACKAGES"
|
[ "$VERBOSE" = true ] && echo "ENV : $PACKAGES"
|
||||||
|
|
||||||
@@ -137,12 +137,13 @@ done
|
|||||||
[ "$PACKMANAGER" = "apt" ] && apt-get update >/dev/null || true
|
[ "$PACKMANAGER" = "apt" ] && apt-get update >/dev/null || true
|
||||||
|
|
||||||
# Install apps one by one to allow failures
|
# Install apps one by one to allow failures
|
||||||
|
ERROR=0
|
||||||
for packagestoinstall in $PACKAGES; do
|
for packagestoinstall in $PACKAGES; do
|
||||||
[ "$VERBOSE" = true ] && echo "... $packagestoinstall"
|
[ "$VERBOSE" = true ] && echo "... $packagestoinstall"
|
||||||
if [ "$PACKMANAGER" = "apk" ]; then
|
if [ "$PACKMANAGER" = "apk" ]; then
|
||||||
apk add --no-cache $packagestoinstall &>/dev/null || echo "Error : $packagestoinstall not found"
|
apk add --no-cache $packagestoinstall &>/dev/null || (echo "Error : $packagestoinstall not found" && ERROR = 1)
|
||||||
elif [ "$PACKMANAGER" = "apt" ]; then
|
elif [ "$PACKMANAGER" = "apt" ]; then
|
||||||
apt-get install -yqq --no-install-recommends $packagestoinstall &>/dev/null || echo "Error : $packagestoinstall not found"
|
apt-get install -yqq --no-install-recommends $packagestoinstall &>/dev/null || (echo "Error : $packagestoinstall not found" && ERROR = 1)
|
||||||
fi
|
fi
|
||||||
[ "$VERBOSE" = true ] && echo "... $packagestoinstall done"
|
[ "$VERBOSE" = true ] && echo "... $packagestoinstall done"
|
||||||
done
|
done
|
||||||
@@ -211,3 +212,7 @@ for files in "/scripts" "/etc/services.d" "/etc/cont-init.d"; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ $ERROR = 1 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user