diff --git a/scripts/actions/add_multimedia_directories b/scripts/actions/add_multimedia_directories index 2f34980..4dc7881 100755 --- a/scripts/actions/add_multimedia_directories +++ b/scripts/actions/add_multimedia_directories @@ -15,6 +15,8 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + #================================================= # CHECK IF ARGUMENTS ARE CORRECT #================================================= @@ -23,6 +25,12 @@ app=$YNH_APP_INSTANCE_NAME # DEFINE FUNCTION #================================================= +# Define a function to execute commands with `occ` +exec_occ() { + (cd "$final_path" && exec_as "$app" \ + php$YNH_PHP_VERSION 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() {