1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/funkwhale_ynh.git synced 2024-09-03 18:36:24 +02:00
funkwhale_ynh/scripts/remove
eric_G 2372f1f4e9
Testing (#271)
* [autopatch] Automatic patch attempt for helpers 2.1 (#270)

* [autopatch] Automatic patch attempt for helpers 2.1

* Cleaning

* cleaning

---------

Co-authored-by: Yunohost-Bot <>
Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com>

* Auto-update READMEs

* Update manifest.toml

---------

Co-authored-by: YunoHost Bot <yunohost-bot@users.noreply.github.com>
Co-authored-by: yunohost-bot <yunohost@yunohost.org>
2024-09-01 22:25:43 +02:00

65 lines
2 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD REMOVE
#=================================================
# REMOVE SERVICE INTEGRATION IN YUNOHOST
#=================================================
if ynh_hide_warnings yunohost service status "${app}-server" >/dev/null
then
ynh_script_progression "Removing ${app}-server service integration..."
yunohost service remove "${app}-server"
fi
if ynh_hide_warnings yunohost service status "${app}-worker" >/dev/null
then
ynh_script_progression "Removing ${app}-worker service integration..."
yunohost service remove "${app}-worker"
fi
if ynh_hide_warnings yunohost service status "${app}-beat" >/dev/null
then
ynh_script_progression "Removing ${app}-beat service integration..."
yunohost service remove "${app}-beat"
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
ynh_script_progression "Stopping and removing the systemd service..."
ynh_systemctl --service="${app}-beat" --action="stop" --log_path="systemd"
ynh_systemctl --service="${app}-server" --action="stop" --log_path="systemd"
ynh_systemctl --service="${app}-worker" --action="stop" --log_path="systemd"
# Remove the dedicated systemd config
ynh_config_remove_systemd"${app}-beat"
ynh_config_remove_systemd"${app}-server"
ynh_config_remove_systemd"${app}-worker"
ynh_safe_rm "/etc/systemd/system/$app.target"
#=================================================
# REMOVE NGINX CONFIGURATION
#=================================================
ynh_script_progression "Removing NGINX web server configuration..."
# Remove the dedicated NGINX config
ynh_safe_rm "/etc/nginx/conf.d/$domain.d/funkwhale_proxy.conf"
ynh_config_remove_nginx
ynh_config_remove_logrotate
ynh_config_remove_fail2ban
ynh_redis_remove_db $redis_db
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Removal of $app completed"