Centos7系统初始化脚本

前言:

记录一下

代码如下:

#!/bin/bash
#---------------------------------#
# 适用于CentOS7版本        
# Date:2022/07/30          
# Author: yeziqi           
# Description:Centos7 System Init 
#---------------------------------#
selinux=`grep SELINUX=  /etc/selinux/config |awk -F '=' 'NR==2{print $2}'`
local_NICNAME=`ip addr|grep '^2'|awk -F ': ' '{print $2}'`
local_PROFILE=/etc/profile
local_LIMITS=/etc/security/limits.conf 
local_SYSCTL=/etc/sysctl.conf
local_CRON=/var/spool/cron/root
#---------------------基础配置---------------------
#关闭防火墙
echo "关闭防火墙"
systemctl stop firewalld.service
systemctl disable firewalld.service
#关闭seLinux
echo "关闭seLinux"
setenforce 0
if [ $selinux != "disabled" ];then
	sed -i 

你可能感兴趣的:(linux,centos,运维)