diff --git a/scripts/upgrade b/scripts/upgrade index da87e9a..08c490e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -138,6 +138,21 @@ fi #================================================= # SPECIFIC UPGRADE +#================================================= +# UPGRADE LDAP PLUGIN +#================================================= +ynh_script_progression --message="Installing and configuring LDAP plugin..." --weight=3 + +# Download LDAP source +ynh_setup_source --dest_dir="$final_path/user/plugins/login-ldap" --source_id="ldap" + +exec_as $app mkdir -p "$final_path/user/config/plugins/login-ldap" +exec_as $app touch "$final_path/user/accounts/admin.yaml" + +ynh_add_config --template="../conf/login-ldap.yaml" --destination="$final_path/user/config/plugins/login-ldap.yaml" +chown $app:$app "$final_path/user/config/plugins/login-ldap.yaml" +chmod 640 "$final_path/user/config/plugins/login-ldap.yaml" + #================================================= # SECURE FILES AND DIRECTORIES #================================================= @@ -158,21 +173,6 @@ pushd "$final_path" ynh_exec_warn_less yes N | ynh_exec_warn_less exec_as $app php${YNH_PHP_VERSION} bin/gpm update --all-yes --no-interaction || ynh_print_warn --message="Automatic plugin upgrade has failed, you can upgrade them from your Grav admin panel." popd -#================================================= -# INSTALL LDAP PLUGIN -#================================================= -ynh_script_progression --message="Installing and configuring LDAP plugin..." --weight=3 - -pushd "$final_path" - exec_as $app php${YNH_PHP_VERSION} bin/gpm install login-ldap --no-interaction -popd -exec_as $app mkdir -p "$final_path/user/config/plugins/login-ldap" -exec_as $app touch "$final_path/user/accounts/admin.yaml" - -ynh_add_config --template="../conf/login-ldap.yaml" --destination="$final_path/user/config/plugins/login-ldap.yaml" -chown $app:$app "$final_path/user/config/plugins/login-ldap.yaml" -chmod 640 "$final_path/user/config/plugins/login-ldap.yaml" - #================================================= # CREATE A CRON TASK #=================================================