From f20e7fc48f916313ddef15237033bfe70acaf94d Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 13 Jan 2025 13:55:49 -0500 Subject: [PATCH] fix: make sure to fail rather than continue if rsync fails Signed-off-by: Josh --- docker-entrypoint.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8e178f2ec..03b2940f0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -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