#!/bin/sh
#
# Stops firewall by clearing iptables.conf
#
iptables -F
iptables -X
#
# Apply firewall rules so that VNC & Modbus are not allowed if so required
#
_input=/etc/network/firewall.rules
if test -f "$_input"
	then
	while IFS= read -r str
	  do
	  if [ ${str:0:1} != "#" ];
	    then
	    iptables $str
	  fi
	  done <"$_input"
fi
iptables-save > /etc/iptables.conf
rm /etc/network/firewall-is-on
