标签:config $? uuid mamicode dos swap error 文件系统 sys
1、编写脚本selinux.sh,实现开启或禁用SELinux功能#!/bin/bash
[ $# -ne 1 ] && echo "Usage:bash $0 <off|on>" && exit 10
if [ "$1" = "on" ];then
sed -i s/SELINUX=disabled/SELINUX=enforcing/ /etc/selinux/config
[ $? -eq 0 ] && echo "SELinux is on"
/sbin/setenforce 1
elif [ "$1" = "off" ];then
sed -i s/SELINUX=enforcing/SELINUX=disabled/ /etc/selinux/config
[ $? -eq 0 ] && echo "SELinux is off "
/sbin/setenforce 0
else
echo "Error!Please input <on|off>"
exit 20
验证:
[root@centos7 scripts43]#getenforce
Enforcing
[root@centos7 scripts43]#sh selinux.sh
Usage:bash selinux.sh <off|on>
[root@centos7 scripts43]#sh selinux.sh off
SELinux is off
[root@centos7 scripts43]#sh selinux.sh on
SELinux is on
[root@centos7 scripts43]#cat /etc/fstab | awk ‘/^UUID/{sys[$3]++}END{for(i in sys){print i,sys[i]}}‘
swap 2
xfs 4
[root@centos7 scripts43]]#echo "Yd$C@M05MB%9&Bdh7dq+YVixp3vpw" |tr -dc [:digit:]`
[root@centos7 scripts43]#awk ‘{ip[$1]++}END{for(i in ip) {if(ip[i]>99){system("iptables -A INPUT -s "i" -j REJECT")}}}‘ /var/log/httpd/access_log
架构班的小伙伴看这里:
1、使用docker-compose制作nginx+php-fpm,mysql,wordpress镜像,并管理启动,实现wordpress的访问
2、使用ansible进行K8s初始化安装配置。
标签:config $? uuid mamicode dos swap error 文件系统 sys
原文地址:https://blog.51cto.com/5440126/2475095