All pastes #3737070 Raw Edit

Untitled

public unlisted text v1 · immutable
#3737070 ·published 2016-11-07 06:57 UTC
rendered paste body
#!/bin/bash
app=$1

usage() {
   echo "usage: $0 appname"
   exit 1
}

test -z $app && usage

NOW=$(date '+%Y%m%d%H%M%S')
mkdir -p ~/selinux
pushd ~/selinux
grep $app /var/log/audit/audit.log | audit2allow -M ${app}_local_$NOW
test "$2" == "--auto" && semodule -i ${app}_local_$NOW.pp