Fix for pfctl on start/stop commands, clean up excess double quotes

This commit is contained in:
Jose
2020-04-16 07:53:53 -04:00
parent 5249e2580a
commit f54151cf94
2 changed files with 8 additions and 4 deletions

View File

@@ -89,8 +89,10 @@ for _jail in ${JAILS}; do
fi
## add ip4.addr to firewall table:jails
if grep "interface = ${bastille_network_loopback}" "${bastille_jailsdir}/${_jail}/jail.conf"; then
pfctl -q -t jails -T add "$(jls -j "${_jail}" ip4.addr)"
if [ -n "${bastille_network_loopback}" ]; then
if grep -qw "interface.*=.*${bastille_network_loopback}" "${bastille_jailsdir}/${_jail}/jail.conf"; then
pfctl -q -t jails -T add "$(jls -j ${_jail} ip4.addr)"
fi
fi
fi
echo