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
2018-03-15 23:33:57 +01:00

54 lines
No EOL
1.1 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
set -u
# Import common cmd
source ./experimental_helper.sh
source ./_common.sh
# LOAD SETTINGS
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
db_user="pgadmin"
#=================================================
# STANDARD REMOVE
#=================================================
# 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"
# Remove app data
ynh_secure_remove /var/lib/pgadmin
# Remove logrotate
ynh_remove_logrotate
# Remove logs
ynh_secure_remove /var/log/pgadmin
# Remove the dedicated nginx config
ynh_remove_nginx_config
# Remove uwsgi config
ynh_secure_remove /etc/uwsgi/apps-enabled/pgadmin.ini
# Delete a system user
ynh_system_user_delete $app
# reload uwsgi
systemctl restart uwsgi