done
# read values from meshwizard
-for v in system luci_main contact community wan lan; do
+for v in system luci_main contact community wan lan general; do
get_var meshwizard.$v
done
# Setup dyngw_plain
# If Sharing of Internet is enabled then enable dyngw_plain plugin
-sharenet=$(uci -q get meshwizard.general.sharenet)
-if [ "$sharenet" == 1 ]; then
+if [ "$general_sharenet" == 1 ]; then
uci set olsrd.dyngw_plain=LoadPlugin
uci set olsrd.dyngw_plain.ignore=0
uci set olsrd.dyngw_plain.library="olsrd_dyn_gw_plain.so.0.4"
--- /dev/null
+#!/bin/sh
+
+. $dir/functions.sh
+
+uci batch << EOF
+ set freifunk-policyrouting.pr.enable=1
+ set freifunk-policyrouting.pr.strict=1
+ set freifunk-policyrouting.pr.zones="freifunk"
+EOF
+
+uci_commitverbose "Setup policyrouting" freifunk-policyrouting
$dir/helpers/setup_lan_static.sh
fi
+# Setup policyrouting if internet sharing is disabled and wan is not used for olsrd
+# Always disable it first to make sure its disabled when the user decied to share his internet
+uci set freifunk-policyrouting.pr.enable=0
+if [ ! "$sharenet" == 1 ] && [ ! "$(uci -q get meshwizard.netconfig.wan_proto)" == "olsr" ]; then
+ $dir/helpers/setup_policyrouting.sh
+fi
+
# Configure found networks
for net in $networks; do
# radioX devices need to be renamed