1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00
wallabag2_ynh/scripts/remove
JimboJoe 29ccad06f6 Refactoring, backup/restore, multi-instance (#28)
* Refactoring, backup/restore, multi-instance

* Use dedicated system user, backup before upgrade

* Set directory rights (fixes #31), point to localhost (fixes #29), use up-to-date php-fpm.conf

* Install dependencies when restoring

* Set Wallabag URL in internal settings

* Fix upgrade, use more forthcoming helpers

* fix #32, use latest mysql helpers

* Small fixes (redundant file, up-to-date check_process, syntax correction on app.src)
2017-05-18 15:24:33 +02:00

67 lines
No EOL
1.8 KiB
Bash

#!/bin/bash
# Treat unset variables as an error
set -u
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
domain=$(ynh_app_setting_get "$app" domain)
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
#=================================================
# REMOVE THE MYSQL DB
#=================================================
ynh_mysql_remove_db "$app" "$db_name"
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_secure_remove "/var/www/$app"
#=================================================
# REMOVE NGINX AND PHP-FPM CONFIGURATION
#=================================================
ynh_remove_fpm_config
ynh_remove_nginx_config
# Reload services
sudo systemctl restart php5-fpm
sudo systemctl reload nginx
#=================================================
# REMOVE DEPENDENCIES
#=================================================
ynh_remove_app_dependencies
# The following command is keeped as a matter of transition with the previous way
# of managing dependencies
ynh_package_autoremove "wallabag-deps" || true
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_system_user_delete $app