addfirewall.sh - add logic so it doesn't retry to add firewall rules

This commit is contained in:
Mike Reeves
2018-09-18 15:38:03 -04:00
parent 07f2fed5c0
commit 22afe036a8

View File

@@ -5,5 +5,9 @@
POLICY=$1
IPADDRESS=$2
echo " - $2" >> /opt/so/saltstack/pillar/firewall/$1.sls
salt-call state.apply firewall
if grep -q $2 "/opt/so/saltstack/pillar/firewall/$1.sls"; then
echo "Firewall Rule Already There"
else
echo " - $2" >> /opt/so/saltstack/pillar/firewall/$1.sls
salt-call state.apply firewall
fi