1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Quote around variables to avoid miserably crashing if variable is empty

This commit is contained in:
Alexandre Aubin 2019-02-24 14:11:33 +01:00 committed by GitHub
parent a937450910
commit 1a2d322017
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ fi
current_version=$(grep OC_VersionString "$final_path/version.php" | cut -d\' -f2)
current_major_version=${current_version%%.*}
if [ $current_major_version -gt 11 ]
if [ "$current_major_version" -gt 11 ]
then
# Inform the backup/restore process that it should not save the data directory
ynh_app_setting_set $app backup_core_only 1
@ -73,7 +73,7 @@ ynh_abort_if_errors
#=================================================
ynh_handle_app_migration "owncloud" "owncloud_migration"
if [ $migration_process -eq 1 ]
if [ "$migration_process" -eq 1 ]
then
# If a migration has been perform
# Reload some values changed by the migration process
@ -270,7 +270,7 @@ exec_occ config:system:get logout_url >/dev/null 2>&1 \
#=================================================
# Enable External Storage and create local mount to home folder as needed
if [ $user_home -eq 1 ]; then
if [ "$user_home" -eq 1 ]; then
exec_occ app:enable files_external
exec_occ files_external:list --output=json \
| grep -q '"storage":"\\\\OC\\\\Files\\\\Storage\\\\Local"' \
@ -372,7 +372,7 @@ systemctl reload nginx
# FINISH MIGRATION PROCESS
#=================================================
if [ $migration_process -eq 1 ]
if [ "$migration_process" -eq 1 ]
then
echo "ownCloud has been successfully migrated to Nextcloud! \
A last scheduled operation will run in a couple of minutes to finish the \