#!/bin/bash
set -u

source "$(dirname "$0")"/custom/common.sh

if [ ! -f "${FIREWALL_CFG_FILE}" ]; then
	exit 0
fi

cat "${FIREWALL_CFG_FILE}" | setman-backup "${FIREWALL_SETS_NAME}" dynamic_config.json

if [ $? -ne 0 ]; then
	setman-log error "firewall/dynamic-config backup failed"
fi
