1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00
jellyfin_ynh/scripts/remove
2024-06-29 16:26:57 +02:00

62 lines
2.1 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
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 >/dev/null
then
ynh_script_progression --message="Removing $app service integration..." --weight=3
yunohost service remove "$app"
fi
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1
ynh_remove_logrotate
ynh_remove_nginx_config
#=================================================
# REMOVE PACKAGES
#=================================================
ynh_script_progression --message="Removing packages..." --weight=1
ynh_remove_app_dependencies
#=================================================
# CLOSE A PORT
#=================================================
ynh_script_progression --message="Checking whether to open ports..." --weight=1
configure_jellyfin_discovery_ports remove
#=================================================
# SPECIFIC REMOVE
#=================================================
# REMOVE VARIOUS FILES
#=================================================
ynh_script_progression --message="Removing various files..." --weight=1
ynh_secure_remove --file="$config_path"
ynh_secure_remove --file="/etc/systemd/system/jellyfin.service.d"
ynh_secure_remove --file="/etc/sudoers.d/jellyfin-sudoers"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Removal of $app completed" --last