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

54 lines
1.5 KiB
Bash

#!/bin/bash
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source ynh_add_swap
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
# 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
yunohost service remove "$app-web"
fi
if ynh_exec_warn_less yunohost service status "$app-sidekiq" >/dev/null; then
yunohost service remove "$app-sidekiq"
fi
if ynh_exec_warn_less yunohost service status "$app-streaming" >/dev/null; then
yunohost service remove "$app-streaming"
fi
# Remove the dedicated systemd config
ynh_remove_systemd_config --service="$app-web"
ynh_remove_systemd_config --service="$app-sidekiq"
ynh_remove_systemd_config --service="$app-streaming"
# Remove the dedicated NGINX config
ynh_remove_nginx_config
# Remove a cron file
ynh_secure_remove --file="/etc/cron.d/$app"
# Remote logrotate config
ynh_remove_logrotate
# Remove metapackage and its dependencies
ynh_remove_ruby
ynh_remove_nodejs
# Remove swap
ynh_del_swap
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last