diff --git a/scripts/install b/scripts/install index 7aa6db0..1067442 100644 --- a/scripts/install +++ b/scripts/install @@ -63,9 +63,12 @@ ynh_script_progression --message="Finding an available port..." --weight=1 port=$(ynh_find_port --port=3000) ynh_app_setting_set --app=$app --key=port --value=$port +# Find an available port +adguard_port=$(ynh_find_port --port=53) +ynh_app_setting_set --app=$app --key=port --value=$adguard_port + # Disable the port 53 for upnp -ynh_exec_fully_quiet yunohost firewall disallow Both 53 --no-reload -ynh_exec_fully_quiet yunohost firewall allow Both 53 --no-upnp +ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $adguard_port #================================================= # CREATE DEDICATED USER diff --git a/scripts/remove b/scripts/remove index 26bbb02..1effac9 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +adguard_port=$(ynh_app_setting_get --app=$app --key=adguard_port) #================================================= # STANDARD REMOVE @@ -61,10 +62,10 @@ ynh_remove_nginx_config # CLOSE A PORT #================================================= -if yunohost firewall list | grep -q "\- $port$" +if yunohost firewall list | grep -q "\- $adguard_port$" then - ynh_script_progression --message="Closing port 53..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP 53 + ynh_script_progression --message="Closing port $adguard_port..." --weight=1 + ynh_exec_warn_less yunohost firewall disallow TCP $adguard_port fi #=================================================