mirror of
https://github.com/YunoHost-Apps/abantecart_ynh.git
synced 2024-09-03 18:06:16 +02:00
Big Refactoring
This commit is contained in:
parent
4e5d0b8e8c
commit
230839d588
1 changed files with 34 additions and 16 deletions
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC STARTING
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
source .fonctions
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -17,40 +17,58 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
db_name=$(ynh_app_setting_get $app db_name)
|
db_name=$(ynh_app_setting_get $app db_name)
|
||||||
|
db_user=$db_name
|
||||||
|
final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE SQL BDD
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_mysql_remove_db $db_name $db_name # Suppression de la base de donnée et de l'utilisateur associé.
|
# Remove metapackage and its dependencies
|
||||||
|
ynh_remove_app_dependencies
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE MAIN DIR OF THE APP
|
# REMOVE THE MYSQL DATABASE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
SECURE_REMOVE '/var/www/$app' # Suppression du dossier de l'application
|
# Remove a database if it exists, along with the associated user
|
||||||
|
ynh_mysql_remove_db $db_user $db_name
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE NGINX CONFIGURATION
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
REMOVE_NGINX_CONF # Suppression de la configuration nginx
|
# Remove the app directory securely
|
||||||
|
ynh_secure_remove "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE PHP-FPM CONFIGURATION
|
# REMOVE NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
REMOVE_FPM_CONF # Suppression de la configuration du pool php-fpm
|
# Remove the dedicated nginx config
|
||||||
|
ynh_remove_nginx_config
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# REMOVE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
|
||||||
# Remove app dependencies
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if ynh_package_is_installed "abantecart-deps"; then
|
# Remove the dedicated php-fpm config
|
||||||
ynh_package_autoremove "abantecart-deps"
|
ynh_remove_fpm_config
|
||||||
fi
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE LOGROTATE CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Remove the app-specific logrotate config
|
||||||
|
ynh_remove_logrotate
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC FINALIZATION
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Delete a system user
|
||||||
|
ynh_system_user_delete $app
|
||||||
|
|
Loading…
Add table
Reference in a new issue