We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba44554 commit a81d833Copy full SHA for a81d833
pages/linux/selinuxenabled.md
@@ -0,0 +1,18 @@
1
+# selinuxenabled
2
+
3
+> Check whether SELinux is enabled.
4
+> Returns exit code 0 if SELinux is enabled, and 1 if it is not.
5
+> See also: `getenforce`, `setenforce`, `sestatus`.
6
+> More information: <https://manned.org/selinuxenabled>.
7
8
+- Check if SELinux is enabled (no output; check exit code with `echo $?`):
9
10
+`selinuxenabled`
11
12
+- Check if SELinux is enabled and print the result:
13
14
+`selinuxenabled && echo "SELinux is enabled" || echo "SELinux is disabled"`
15
16
+- Use in a shell script to conditionally execute commands:
17
18
+`if selinuxenabled; then echo "SELinux is running"; fi`
0 commit comments