#!/bin/sh set -eu readonly AUDISPD_EVENTS=/var/run/audispd_events USER=$(id -un) if ! [ -S "$AUDISPD_EVENTS" ]; then echo "Please enable the af_unix plugin (/etc/audit/plugins.d/af_unix.conf" >&2 exit 1 fi config=$(mktemp -t laurel-config.toml.XXXXXXXXXX) trap 'rm -f $config' EXIT sedexpr="s,%USER%,$USER,g; s,%AUDISPD_EVENTS%,$AUDISPD_EVENTS,g" dir=$(dirname "$0") if [ -e "$dir/config.toml.template" ]; then echo "Writing $dir/config.toml.template to $config..." sed "$sedexpr" > "$config" < "$dir/config.toml.template" else echo "Writing internal default template to $config..." sed "$sedexpr" > "$config" <