mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-24 05:35:32 +02:00
fix error handling
This commit is contained in:
14
debian/scripts/iobroker_startup.sh
vendored
14
debian/scripts/iobroker_startup.sh
vendored
@@ -135,19 +135,7 @@ if [[ -f /opt/.first_run ]]; then
|
||||
if [[ "$offlinemode" = "true" ]]; then
|
||||
echo "OFFLINE_MODE is \"true\". Skipping Linux package updates on first run."
|
||||
else
|
||||
echo -n "Updating Linux packages on first run... "
|
||||
set +e
|
||||
bash /opt/scripts/setup_packages.sh -update > /opt/scripts/setup_packages.log 2>&1
|
||||
return=$?
|
||||
set -e
|
||||
if [[ "$return" -ne 0 ]]; then
|
||||
echo "Failed."
|
||||
echo "For more details see \"/opt/scripts/setup_packages.log\"."
|
||||
echo "Make sure the container has internet access to get the latest package updates."
|
||||
echo "This has no impact to the setup process. The script will continue."
|
||||
else
|
||||
echo 'Done.'
|
||||
fi
|
||||
bash /opt/scripts/setup_packages.sh -update
|
||||
fi
|
||||
echo ' '
|
||||
# Installing packages from ENV
|
||||
|
||||
20
debian/scripts/setup_packages.sh
vendored
20
debian/scripts/setup_packages.sh
vendored
@@ -10,7 +10,7 @@ then
|
||||
for i in $packages; do
|
||||
if [ "$(dpkg-query -W -f='${Status}' "$i" 2>/dev/null | grep -c "ok installed")" -eq 0 ];
|
||||
then
|
||||
echo -n "$i is not installed. Installing..."
|
||||
echo -n "$i is not installed. Installing... "
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -q -y install "$i" >> /opt/scripts/setup_packages.log 2>&1
|
||||
return=$?
|
||||
if [[ "$return" -ne 0 ]]; then
|
||||
@@ -24,10 +24,20 @@ then
|
||||
echo "$i is already installed."
|
||||
fi
|
||||
done
|
||||
elif [ "$1" == "-update" ]
|
||||
then
|
||||
apt-get -q update
|
||||
apt-get -q -y upgrade
|
||||
elif [ "$1" == "-update" ]; then
|
||||
echo -n "Updating Linux packages on first run... "
|
||||
apt-get -q update >> /opt/scripts/setup_packages.log 2>&1
|
||||
return=$?
|
||||
apt-get -q -y upgrade >> /opt/scripts/setup_packages.log 2>&1
|
||||
return1=$?
|
||||
if [[ "$return" -ne 0 || "$return1" -ne 0 ]]; then
|
||||
echo "Failed."
|
||||
echo "For more details see \"/opt/scripts/setup_packages.log\"."
|
||||
echo "Make sure the container has internet access to get the latest package updates."
|
||||
echo "This has no impact to the setup process. The script will continue."
|
||||
else
|
||||
echo 'Done.'
|
||||
fi
|
||||
else
|
||||
echo "No paramerter found!"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user