0
点赞
收藏
分享

微信扫一扫

selinux配置

天悦哥 2022-08-02 阅读 61


 

#######################################################
# 检查selinux是否开启
#######################################################
function selinux_check() {
echo ""
echo -e "\033[36m -------------------------------->> \033[0m"
echo -e "\033[36m selinux_check, starting... \033[0m"
echo -e "\033[36m -------------------------------- \033[0m"

local selinux_result=`getenforce`
if [[ $selinux_result == "Enforcing" ]]; then
echo "selinux is Enforcing now, disable first, quit."
cp /etc/selinux/config /etc/selinux/config"`date +"%Y%m%d%H%M%S"`"
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
setenforce 0
echo ""
echo -e "\033[32m ******************************* \033[0m"
echo -e "\033[32m selinux_check, pass... \033[0m"
echo -e "\033[32m ******************************* \033[0m"}
else
echo ""
echo -e "\033[32m ******************************* \033[0m"
echo -e "\033[32m selinux_check, pass... \033[0m"
echo -e "\033[32m ******************************* \033[0m"}
fi
}

 


举报

相关推荐

查看SELinux状态及关闭SELinux

SELinux详解

关闭selinux

SELINUX 服务

Android Selinux

0 条评论