mirror of
https://github.com/YunoHost-Apps/transmission_ynh.git
synced 2024-09-04 01:46:12 +02:00
80 lines
2.4 KiB
Bash
80 lines
2.4 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
port=$(ynh_app_setting_get $app port)
|
|
peer_port=$(ynh_app_setting_get $app peer_port)
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
# REMOVE TRANSMISSION-DAEMON
|
|
#=================================================
|
|
|
|
ynh_package_autoremove transmission-daemon
|
|
|
|
#=================================================
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
#=================================================
|
|
|
|
if sudo yunohost service status | grep -q transmission-daemon # Test l'existence du service dans Yunohost
|
|
then
|
|
echo "Remove transmission-daemon service"
|
|
sudo yunohost service remove transmission-daemon
|
|
fi
|
|
|
|
#=================================================
|
|
# CLOSE THE PORTS
|
|
#=================================================
|
|
|
|
ALL_QUIET sudo yunohost firewall disallow TCP $port
|
|
ALL_QUIET sudo yunohost firewall disallow TCP $peer_port
|
|
|
|
#=================================================
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_remove_nginx_config # Suppression de la configuration nginx
|
|
|
|
#=================================================
|
|
# SPECIFIC REMOVE
|
|
#=================================================
|
|
# REMOVE DATA
|
|
#=================================================
|
|
|
|
backup_core_only=$(ynh_app_setting_get $app backup_core_only)
|
|
if [ -z $backup_core_only ] # Si backup_core_only a une valeur dans le fichier settings.yml, ne supprime pas le dossier data
|
|
then
|
|
ynh_secure_remove /home/yunohost.transmission
|
|
fi
|
|
|
|
# And remove the link in yunohost.multimedia
|
|
sudo rm "/home/yunohost.multimedia/share/Torrents"
|
|
sudo rm "/home/yunohost.multimedia/share/Torrent to download"
|
|
|
|
# Remove config
|
|
ynh_secure_remove /etc/transmission-daemon
|
|
# And data
|
|
ynh_secure_remove /usr/share/transmission
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# REMOVE DEDICATED USER
|
|
#=================================================
|
|
|
|
ynh_system_user_delete debian-transmission
|