Take the 2-minute tour ×

I wanted to create a script that prompts the user to check SE Linux and disable it if the answer is yes.

share|improve this question
The world is your oyster! Go for it! –  Johnsyweb Dec 23 '12 at 22:29
add comment

1 Answer

up vote 1 down vote accepted
ENABLED=`cat /selinux/enforce`
if [ "$ENABLED" == 1 ]; then
  echo "SELinux is enabled, disable? (yes/no):"
  read disable
  if [ $disable == "yes" ]; then
    echo "disabling selinux"
    setenforce 0

This script should be run as root, or with permission to do the following:

cat /selinux/enforce
setenforce 0
share|improve this answer
add comment

Your Answer


