When advanced mode is disabled, the following variables are not declared:
dns
ip6_net
ip4_nat_address
These variables are needed to check if IPv4 and IPv6 DNS are valid and to set them.
When the hotspot is enabled, they are also used to configure the service.
Solution
I moved the code that is splitting IPv4 and IPv6 DNS, in order to reuse them in the DNS validation step.
I make sure that when the advanced mode is disabled, I take variables from the "old" config.
I guess these are the settings before any user changes, which in this case isn't a problem because the fields are hidden from the user.
I also added a check to ensure the hotspot isn't started when it is disabled. Instead, we cleanup some config files, and we restart dnsmasq to make sure changes are updated.
PR Status
[x] Code finished and ready to be reviewed/tested
[x] The fix/enhancement were manually tested (if applicable)
Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
Problem
When advanced mode is disabled, the following variables are not declared:
These variables are needed to check if IPv4 and IPv6 DNS are valid and to set them. When the hotspot is enabled, they are also used to configure the service.
Solution
I moved the code that is splitting IPv4 and IPv6 DNS, in order to reuse them in the DNS validation step.
I make sure that when the advanced mode is disabled, I take variables from the "old" config. I guess these are the settings before any user changes, which in this case isn't a problem because the fields are hidden from the user.
I also added a check to ensure the hotspot isn't started when it is disabled. Instead, we cleanup some config files, and we restart dnsmasq to make sure changes are updated.
PR Status
Automatic tests
Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)