mirror of
https://github.com/YunoHost-Apps/adguardhome_ynh.git
synced 2024-09-03 18:06:23 +02:00
delete unneccessary yunohost firewall reload
This commit is contained in:
parent
6b190a3a94
commit
57fb93edaa
4 changed files with 5 additions and 15 deletions
|
@ -21,12 +21,10 @@ set__open_port_53() {
|
|||
ynh_print_info --message="Opening port 53..."
|
||||
# if the user would expose port 53 to the Internet, open it
|
||||
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
elif [ "$open_port_53" == "false" ]; then
|
||||
# else if false, close it
|
||||
ynh_print_info --message="Closing port 53..."
|
||||
ynh_exec_warn_less yunohost firewall disallow Both 53
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
else
|
||||
# else, throw error
|
||||
ynh_print_warn --message="The variable 'open_port_53' should be 'true' or 'false' but isn't, please report this."
|
||||
|
@ -63,15 +61,13 @@ set__dns_over_https() {
|
|||
if [ "$dns_over_https" == "true" ]; then
|
||||
ynh_print_info --message="Opening DoH and DoQ ports..."
|
||||
# if DNS over HTTPS/QUIC is activated, open the associated ports
|
||||
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http"
|
||||
ynh_exec_warn_less yunohost firewall allow Both "$port_dns_over_http" --no-reload
|
||||
ynh_exec_warn_less yunohost firewall allow UDP "$port_dns_over_quic"
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
elif [ "$dns_over_https" == "false" ]; then
|
||||
# else if false, close them
|
||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
else
|
||||
# else, throw error
|
||||
ynh_print_warn --message="The variable 'dns_over_https' should be 'true' or 'false' but isn't, please report this."
|
||||
|
|
|
@ -23,9 +23,8 @@ else
|
|||
# if dns_over_https is false, we need to close ports,
|
||||
# as they were opened at the 'Provisioning ports' step
|
||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
fi
|
||||
|
||||
ynh_app_setting_set --app="$app" --key=dns_over_https --value="$dns_over_https"
|
||||
|
@ -35,7 +34,6 @@ if [[ $open_port_53 == 0 ]]; then
|
|||
# if open_port_53 is true, we need to open port 53
|
||||
ynh_print_info --message="Opening port 53..."
|
||||
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
else
|
||||
open_port_53="false"
|
||||
ynh_print_info --message="Port 53 is closed."
|
||||
|
|
|
@ -18,15 +18,13 @@ source /usr/share/yunohost/helpers
|
|||
if [ "$dns_over_https" == "false" ]; then
|
||||
# if dns_over_https is false, we need to close ports,
|
||||
# as they were opened at the 'Provisioning ports' step
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
fi
|
||||
|
||||
if [ "$open_port_53" == "true" ]; then
|
||||
# if open_port_53 is true, we need to open port 53
|
||||
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -35,7 +35,6 @@ if [ -z "${open_port_53:-}" ] && [ "${open_port_53:-}" = true ]; then
|
|||
# if open_port_53 is true, we need to open port 53
|
||||
ynh_print_info --message="Opening port 53..."
|
||||
ynh_exec_warn_less yunohost firewall allow Both 53
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
elif [ -n "${open_port_53:-}" ] || [ "${open_port_53:-}" = false ]; then
|
||||
open_port_53="false"
|
||||
ynh_app_setting_set --app="$app" --key=open_port_53 --value="$open_port_53"
|
||||
|
@ -53,9 +52,8 @@ elif [ -n "${dns_over_https:-}" ] || [ "${dns_over_https:-}" = false ]; then
|
|||
# if dns_over_https is false, we need to close ports,
|
||||
# as they were opened at the 'Provisioning ports' step
|
||||
ynh_print_info --message="Closing DoH and DoQ ports..."
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http"
|
||||
ynh_exec_warn_less yunohost firewall disallow Both "$port_dns_over_http" --no-reload
|
||||
ynh_exec_warn_less yunohost firewall disallow UDP "$port_dns_over_quic"
|
||||
ynh_exec_warn_less yunohost firewall reload
|
||||
fi
|
||||
|
||||
# about all those 'ynh_write_var_in_file':
|
||||
|
|
Loading…
Add table
Reference in a new issue