Using the following code I would like to check the status of SeLinux e.g. enforcing, permissive, disabled. If the status is other then disabled, then I will advise the user to disable Selinux.
I'm running the following in a .sh file. The current status of SeLinux is Permissive. Running the following code ends up in the else clause.
#! /bin/bash
SELINUXSTATUS=getenforce;
if [ "$SELINUXSTATUS" == "Permissive" ]; then
echo "Disable SeLinux";
else
echo "All Good. Continue...";
fi;