문제

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

도움이 되었습니까?

해결책

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
  fi
fi

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

cat /selinux/enforce
setenforce 0
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top