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
2017-12-23 22:01:03 +01:00

43 lines
792 B
Bash

#!/bin/bash
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop script if errors
set -u
# Import common cmd
source ./_common.sh
source ./psql.sh
# LOAD SETTINGS
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
db_user="pgadmin"
# 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