Force upgrades

This commit is contained in:
Alexandre
2023-06-19 14:20:05 +02:00
committed by GitHub
parent 4b9ba61633
commit 83130cfca3

View File

@@ -18,30 +18,26 @@ CONTAINERVERSION="$(cat /nextcloudversion)"
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
# Updater code
if ! bashio::config.true "disable_updates"; then
bashio::log.green "Auto_updater set, checking for updates"
# Install new version
bashio::log.green "Checking for nextcloud updates"
# Install new version
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
# Install additional versions
while [[ $(occ update:check 2>&1) == *"update available"* ]]; do
bashio::log.yellow "-----------------------------------------------------------------------"
bashio::log.yellow " new version available, updating. Please do not turn off your addon! "
bashio::log.yellow "-----------------------------------------------------------------------"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
done
if ! bashio::config.true "disable_updates"; then
bashio::log.green "---"
bashio::log.green "Updating apps"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ app:update --all"
# Install additional versions
while [[ $(occ update:check 2>&1) == *"update available"* ]]; do
bashio::log.yellow "-----------------------------------------------------------------------"
bashio::log.yellow " new version available, updating. Please do not turn off your addon! "
bashio::log.yellow "-----------------------------------------------------------------------"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/updater/updater.phar --no-interaction"
sudo -u abc -s /bin/bash -c "php /data/config/www/nextcloud/occ upgrade"
done
# Reset permissions
/./etc/cont-init.d/01-folders.sh
elif bashio::config.true "disable_updates" && [ "$(version "$CONTAINERVERSION")" -gt "$(version "$CURRENTVERSION")" ]; then
bashio::log.warning " "
bashio::log.warning "----------------------------------------- "
bashio::log.warning "New version available : $CONTAINERVERSION"
bashio::log.warning "-----------------------------------------"
bashio::log.warning " "
bashio::log.warning "...auto_updater not set in addon options, please update from nextcloud settings"
bashio::log.warning "If you don't update you risk an addon breakage !"
bashio::log.warning " "
bashio::log.warning "-----------------------------------------"
else
bashio::log.green "disable_updates set, please update the apps manually"
fi
# Reset permissions
/./etc/cont-init.d/01-folders.sh