0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-02-05 02:58:27 +01:00

fix: make sure to fail rather than continue if rsync fails

Signed-off-by: Josh <josh.t.richards@gmail.com>
This commit is contained in:
Josh 2025-01-13 13:55:49 -05:00 committed by GitHub
parent 7f707b6c5d
commit f20e7fc48f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,12 +172,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
if [ "$?" -ne "0" ]; then
echo "Rsync failed. Giving up to be safe."
exit 1
fi
for dir in config data custom_apps themes; do
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
if [ "$?" -ne "0" ]; then
echo "Rsync failed. Giving up to be safe."
exit 1
fi
fi
done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
if [ "$?" -ne "0" ]; then
echo "Rsync failed. Giving up to be safe."
exit 1
fi
# Install
if [ "$installed_version" = "0.0.0.0" ]; then