Skip to content
Snippets Groups Projects
Unverified Commit f20e7fc4 authored by Josh's avatar Josh Committed by GitHub
Browse files

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


Signed-off-by: default avatarJosh <josh.t.richards@gmail.com>
parent 7f707b6c
Branches
Tags
No related merge requests found
...@@ -172,12 +172,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP ...@@ -172,12 +172,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
fi fi
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/ 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 for dir in config data custom_apps themes; do
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then 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/ 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 fi
done done
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/ 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 # Install
if [ "$installed_version" = "0.0.0.0" ]; then if [ "$installed_version" = "0.0.0.0" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment