#!/bin/sh

set -e

# Trigger a restart after installing Recommends to make
# sure firewalld picks up ipset, ebtables etc.
systemctl restart firewalld

# Give firewalld some time to settle
sleep 15

if ! systemctl -q is-active firewalld ; then
	journalctl -u firewalld
	exit 1
fi

systemctl status firewalld

# We don't want any warnings or errors in the log
if systemctl status firewalld | grep -q -E "(ERROR|WARNING)" ; then
	exit 1
fi
