#!/bin/bash

if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

case "${DISTRO_NAME}" in
    fedora | centos | centos7 | rhel | rhel7 )
        if which systemctl && [[ $(systemctl --no-pager list-unit-files firewalld) =~ 'enabled' ]]; then
            systemctl disable firewalld
        fi
    ;;
    * )
        echo "Unknown distro: $DISTRO_NAME. Skipping."
    ;;
esac
