#!/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 onphp
[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:]`
mysql
[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_loglinux
架構班的小夥伴看這裏:nginx
一、使用docker-compose製做nginx+php-fpm,mysql,wordpress鏡像,並管理啓動,實現wordpress的訪問git
二、使用ansible進行K8s初始化安裝配置。web