selinuxenabled - Man Page
tool to be used within shell scripts to determine if selinux is enabled
Examples (TL;DR)
- Check if SELinux is enabled (no output; check exit code with
echo $?):selinuxenabled - Check if SELinux is enabled and print the result:
selinuxenabled && echo "SELinux is enabled" || echo "SELinux is disabled" - Use in a shell script to conditionally execute commands:
if selinuxenabled; then echo "SELinux is running"; fi
Synopsis
selinuxenabled
Description
Indicates whether SELinux is enabled or disabled.
Exit Status
It exits with status 0 if SELinux is enabled and 1 if it is not enabled.
Author
Dan Walsh, <dwalsh@redhat.com>
See Also
Referenced By
7 April 2004 dwalsh@redhat.com SELinux Command Line documentation