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

76 lines
2.4 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source ynh_add_swap
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status "$app-web" >/dev/null
then
ynh_script_progression --message="Removing $app-web service integration..." --weight=1
yunohost service remove "$app-web"
fi
if ynh_exec_warn_less yunohost service status "$app-sidekiq" >/dev/null
then
ynh_script_progression --message="Removing $app-sidekiq service integration..." --weight=1
yunohost service remove "$app-sidekiq"
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1
ynh_remove_systemd_config --service="$app-web"
ynh_remove_systemd_config --service="$app-sidekiq"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
ynh_remove_nginx_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================
#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=1
# Remove metapackage and its dependencies
ynh_remove_ruby
#REMOVEME? ynh_remove_app_dependencies
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..." --weight=1
# Remove a directory securely
ynh_secure_remove --file="/etc/$app"
# Remove the log files
ynh_secure_remove --file="/var/log/$app"
# Remove swap
ynh_del_swap
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last