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

54 lines
1.1 KiB
Text
Raw Normal View History

2017-11-14 16:05:26 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
2017-11-14 16:05:26 +01:00
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
set -u
# Import common cmd
source ./experimental_helper.sh
2017-11-14 16:05:26 +01:00
source ./_common.sh
# LOAD SETTINGS
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
2017-11-16 21:10:21 +01:00
db_user="pgadmin"
2017-11-14 16:05:26 +01:00
#=================================================
# STANDARD REMOVE
#=================================================
2017-11-14 16:05:26 +01:00
# Remove db user
ynh_psql_drop_user $db_user
# Remove depandance
ynh_remove_app_dependencies || true
# Remove the app directory securely
ynh_secure_remove "$final_path"
2017-11-16 21:10:21 +01:00
# Remove app data
ynh_secure_remove /var/lib/pgadmin
# Remove logrotate
ynh_remove_logrotate
# Remove logs
ynh_secure_remove /var/log/pgadmin
2017-11-14 16:05:26 +01:00
# Remove the dedicated nginx config
ynh_remove_nginx_config
2017-11-16 21:10:21 +01:00
# Remove uwsgi config
ynh_secure_remove /etc/uwsgi/apps-enabled/pgadmin.ini
2017-11-14 16:05:26 +01:00
# Delete a system user
ynh_system_user_delete $app
2018-03-15 23:33:57 +01:00
# reload uwsgi
systemctl restart uwsgi