diff --git a/scripts/install b/scripts/install index 3cfff11..d807a74 100644 --- a/scripts/install +++ b/scripts/install @@ -59,14 +59,14 @@ ynh_app_setting_set $app port $port # Find a free port peer_port=$(ynh_find_port 51413) # Open this port -yunohost firewall allow TCP $peer_port >/dev/null 2>&1 +yunohost firewall allow Both $peer_port >/dev/null 2>&1 ynh_app_setting_set $app peer_port $peer_port #================================================= # INSTALL TRANSMISSION #================================================= -ynh_package_install transmission-daemon +ynh_install_app_dependencies transmission-daemon acl #================================================= # NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index f89c7f8..f09a23c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,8 +25,7 @@ peer_port=$(ynh_app_setting_get $app peer_port) # REMOVE TRANSMISSION-DAEMON #================================================= -ynh_apt purge transmission-daemon -ynh_package_autoremove transmission-common +ynh_remove_app_dependencies #================================================= # DISABLE SERVICE IN ADMIN PANEL @@ -51,7 +50,7 @@ fi if yunohost firewall list | grep -q "\- $peer_port$" then echo "Close port $peer_port" - yunohost firewall disallow TCP $peer_port 2>&1 + yunohost firewall disallow Both $peer_port 2>&1 fi #================================================= diff --git a/scripts/restore b/scripts/restore index bb6e1ce..f10f782 100644 --- a/scripts/restore +++ b/scripts/restore @@ -52,7 +52,7 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= yunohost firewall allow --no-upnp TCP $port >/dev/null 2>&1 -yunohost firewall allow TCP $peer_port >/dev/null 2>&1 +yunohost firewall allow Both $peer_port >/dev/null 2>&1 #================================================= # SPECIFIC RESTORE @@ -60,7 +60,7 @@ yunohost firewall allow TCP $peer_port >/dev/null 2>&1 # REINSTALL TRANSMISSION #================================================= -ynh_package_install transmission-daemon +ynh_install_app_dependencies transmission-daemon acl #================================================= # RESTORE TRANSMISSION CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 45f99fa..43eb9f2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,6 +33,9 @@ if [ -z $peer_port ]; then ynh_app_setting_set $app peer_port $peer_port fi +# Add peer_port also on UDP. +yunohost firewall allow UDP $peer_port >/dev/null 2>&1 + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= @@ -63,6 +66,12 @@ path_url=$(ynh_normalize_url_path $path_url) [ "$path_url" = "/" ] || path_url=${path_url}/ ynh_add_nginx_config +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +ynh_install_app_dependencies transmission-daemon acl + #================================================= # SPECIFIC UPGRADE #=================================================