1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invoiceninja_ynh.git synced 2024-09-03 19:26:22 +02:00
invoiceninja_ynh/scripts/remove

74 lines
2.4 KiB
Text
Raw Normal View History

2020-05-02 10:17:12 +02:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
2020-05-10 10:08:46 +02:00
ynh_script_progression --message="Loading installation settings..."
2020-05-02 10:17:12 +02:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE THE MYSQL DATABASE
#=================================================
2020-05-10 10:08:46 +02:00
ynh_script_progression --message="Removing the MySQL database..."
2020-05-02 10:17:12 +02:00
# Remove a database if it exists, along with the associated user
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
#=================================================
# REMOVE APP MAIN DIR
#=================================================
2020-05-10 10:08:46 +02:00
ynh_script_progression --message="Removing app main directory..."
2020-05-02 10:17:12 +02:00
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
2021-05-16 15:47:40 +02:00
ynh_script_progression --message="Removing NGINX web server configuration..."
2020-05-02 10:17:12 +02:00
2021-05-16 15:47:40 +02:00
# Remove the dedicated NGINX config
2020-05-02 10:17:12 +02:00
ynh_remove_nginx_config
2020-05-03 12:03:47 +02:00
#=================================================
# REMOVE PHP-FPM CONFIGURATION
#=================================================
2021-05-16 15:47:40 +02:00
ynh_script_progression --message="Removing PHP-FPM configuration..."
2020-05-03 12:03:47 +02:00
2021-05-16 15:47:40 +02:00
# Remove the dedicated PHP-FPM config
2020-05-03 12:03:47 +02:00
ynh_remove_fpm_config
2020-05-02 10:17:12 +02:00
#=================================================
# SPECIFIC REMOVE
#=================================================
2021-08-20 19:40:50 +02:00
# REMOVE VARIOUS FILES
2020-05-02 10:17:12 +02:00
#=================================================
2021-08-20 19:40:50 +02:00
ynh_script_progression --message="Removing various files..."
2020-05-02 10:17:12 +02:00
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed"