Commit 066f1164 authored by Meifa Tang's avatar Meifa Tang

if centos then disable selinux

parent 76921a8d
...@@ -10,7 +10,15 @@ ...@@ -10,7 +10,15 @@
# ---------------------------------------------------------------- # ----------------------------------------------------------------
off_selinux() { off_selinux() {
THE_OS=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [ "$THE_OS" == "\"CentOS Linux\"" ];then
SELINUX_CONFIG="/etc/selinux/config"
SELinux_Flage=`getenforce`
if [ "$SELinux_Flage" != "Disabled" ];then
[ -f ${SELINUX_CONFIG} ] && cp -a ${SELINUX_CONFIG}{,.bak}
/bin/sed -i -r 's@^SELINUX=(enforcing|permissive)$@SELINUX=disabled@g' ${SELINUX_CONFIG} && /usr/sbin/setenforce 0
fi
fi
} }
off_firewalld() { off_firewalld() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment