1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/adguardhome_ynh.git synced 2024-09-03 18:06:23 +02:00
This commit is contained in:
ericgaspar 2021-08-08 10:01:19 +02:00
parent a20b6ccee7
commit 72cc2b98ba
2 changed files with 9 additions and 5 deletions

View file

@ -63,9 +63,12 @@ ynh_script_progression --message="Finding an available port..." --weight=1
port=$(ynh_find_port --port=3000) port=$(ynh_find_port --port=3000)
ynh_app_setting_set --app=$app --key=port --value=$port 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 # Disable the port 53 for upnp
ynh_exec_fully_quiet yunohost firewall disallow Both 53 --no-reload ynh_exec_warn_less yunohost firewall allow --no-upnp TCP $adguard_port
ynh_exec_fully_quiet yunohost firewall allow Both 53 --no-upnp
#================================================= #=================================================
# CREATE DEDICATED USER # CREATE DEDICATED USER

View file

@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
adguard_port=$(ynh_app_setting_get --app=$app --key=adguard_port)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -61,10 +62,10 @@ ynh_remove_nginx_config
# CLOSE A PORT # CLOSE A PORT
#================================================= #=================================================
if yunohost firewall list | grep -q "\- $port$" if yunohost firewall list | grep -q "\- $adguard_port$"
then then
ynh_script_progression --message="Closing port 53..." --weight=1 ynh_script_progression --message="Closing port $adguard_port..." --weight=1
ynh_exec_warn_less yunohost firewall disallow TCP 53 ynh_exec_warn_less yunohost firewall disallow TCP $adguard_port
fi fi
#================================================= #=================================================