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

Change scope of create_external_storage as well

This commit is contained in:
Jimmy Monin 2019-08-10 17:20:47 +02:00
parent b60691e6f3
commit 8482d00f1a

View file

@ -182,6 +182,18 @@ exec_occ() {
php occ --no-interaction --no-ansi "$@") php occ --no-interaction --no-ansi "$@")
} }
# Define a function to add an external storage
# Create the external storage for the given folders and enable sharing
create_external_storage() {
local datadir="$1"
local mount_name="$2"
local mount_id=`exec_occ files_external:create --output=json \
"$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true`
! [[ $mount_id =~ ^[0-9]+$ ]] \
&& ynh_print_warn --message="Unable to create external storage" \
|| exec_occ files_external:option "$mount_id" enable_sharing true
}
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading nextcloud..." --weight=3 ynh_script_progression --message="Upgrading nextcloud..." --weight=3
@ -323,18 +335,6 @@ then
# MOUNT HOME FOLDERS AS EXTERNAL STORAGE # MOUNT HOME FOLDERS AS EXTERNAL STORAGE
#================================================= #=================================================
# Define a function to add an external storage
# Create the external storage for the given folders and enable sharing
create_external_storage() {
local datadir="$1"
local mount_name="$2"
local mount_id=`exec_occ files_external:create --output=json \
"$mount_name" 'local' 'null::null' -c "datadir=$datadir" || true`
! [[ $mount_id =~ ^[0-9]+$ ]] \
&& ynh_print_warn --message="Unable to create external storage" \
|| exec_occ files_external:option "$mount_id" enable_sharing true
}
# Enable External Storage and create local mount to home folder as needed # 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 app:enable files_external