Skip to content

Instantly share code, notes, and snippets.

@louis89
Created May 30, 2015 22:39
Show Gist options
  • Save louis89/e9334e0c7d2f356f0004 to your computer and use it in GitHub Desktop.
Save louis89/e9334e0c7d2f356f0004 to your computer and use it in GitHub Desktop.
Script for compiling SELinux policy files
!/bin/bash
# Call this script with the name of the source policy file.
# The policy file is expected to have the extension .te
if [ $1 ]; then
m4 "$1.te" > "$1.m4.te"
checkmodule -M -m "$1.m4.te" -o "$1.mod"
semodule_package -o "$1.pp" -m "$1.mod"
else
echo "This script requires parameter 1 to be the name of the policy source file to be compiled."
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment