#!/bin/bash
# packages = audit

if [[ "$style" == "modern" ]] ; then
    escaped_path=$(echo "$path" | sed 's/\//\\\//g')
    sed -i "/$filter_type=$escaped_path/d" /etc/audit/audit.rules
    echo "-a always,exit -F arch=b32 -F $filter_type=$path -F perm=w" >> /etc/audit/audit.rules
    echo "-a always,exit -F arch=b64 -F $filter_type=$path -F perm=w" >> /etc/audit/audit.rules
else
    sed -i "\#-w $path#d" /etc/audit/audit.rules
    echo "-w $path -p w" >> /etc/audit/audit.rules
fi
