#!/bin/bash # Quit script if something goes wrong set -o errexit -o nounset -o pipefail; SCRIPTDIR="$( dirname "$(readlink -f "$0")" )"; OUTFILE="${SCRIPTDIR}/../whitelists/magento1ce.yar"; TMPFILE="${OUTFILE}.new"; # First empty the target whitelist so we can completely generate a new one cat <"${OUTFILE}"; private rule Magento1Ce : ECommerce { condition: false } EOF # Create a temporary directory and make sure it is empty GENTEMPDIR="$( mktemp -d --suffix="_gen_whitelist_m1" )"; # Add header to whitelist tempfile cat < "${OUTFILE}"; # Clean up rm "${TMPFILE}"; rm -rf "${GENTEMPDIR}";