#!/bin/bash

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

if [ "$DISTRO_NAME" = "fedora" ]; then
    install-packages iptables-services
fi

case "${DISTRO_NAME}" in
    fedora | centos | rhel )
        if which service; then
            service iptables save
            chkconfig iptables off
        fi
    ;;
    * )
        echo "Unknown distro: $DISTRO_NAME. Skipping."
    ;;
esac
