#!/bin/bash
sed -i -e "s/^IIAB_GATEWAY_ENABLED.*/IIAB_GATEWAY_ENABLED=True/" {{ iiab_env_file }}
/usr/bin/iiab-gen-iptables

cat << EOF

IIAB Firewall Documentation
http://box.lan/info/IIAB-Networking.html#firewall-iptables
https://github.com/iiab/iiab/wiki/IIAB-Networking#firewall-iptables

WARNING: If you want to _permanently_ change your IIAB's default behavior
(i.e. to specify whether student/client devices should have Internet or not,
in general!) then modify variable 'iiab_gateway_enabled' in
/etc/iiab/local_vars.yml — and finally run: sudo iiab-network
EOF
