diff --git a/hooks/post_iptables_rules b/hooks/post_iptables_rules index 903c649..cb99f53 100644 --- a/hooks/post_iptables_rules +++ b/hooks/post_iptables_rules @@ -1,68 +1,57 @@ #!/bin/bash -multissid=$(grep multissid /etc/yunohost/apps/hotspot/settings.yml | cut -d: -f2 | sed "s/[ ']//g") -interface=$(grep wifi_device /etc/yunohost/apps/hotspot/settings.yml | cut -d: -f2 | sed "s/[ ']//g") -IFS='|' read -a captive_portal <<< "$(grep captive_portal /etc/yunohost/apps/hotspot/settings.yml | grep -v captive_portal_url | cut -d: -f2 | sed "s/[ ']//g")" -IFS='|' read -a ipv4 <<< "$(grep ip4_nat_prefix /etc/yunohost/apps/hotspot/settings.yml | cut -d: -f2 | sed "s/[ ']//g")" -IFS='|' read -a ipv6 <<< "$(grep ip6_net /etc/yunohost/apps/hotspot/settings.yml | cut -d: -f2 | sed "s/[ ']//g")" +wifi_device=$(ynh_app_setting_get --app=$app --key=wifi_device) +captive_portal=$(ynh_app_setting_get --app=$app --key=captive_portal) +ip4_prefix=$(ynh_app_setting_get --app=$app --key=ip4_nat_prefix) +ip6_prefix=$(ynh_app_setting_get --app=$app --key=ip6_net) iptables -w -N hotspot_fwd ip6tables -w -N hotspot_fwd -for (( j=0; j