最小化安装后执行的脚本
#!/bin/bash
#author by gwl
###2021-11-25 centos7最小化安装配置
yum install wget ntpdate telnet vim net-tools bash-completion gcc gcc-c++ make -y
sed -i.bak 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
systemctl disable firewalld
systemctl stop firewalld
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum clean all
yum makecache fast
yum install -y docker-ce
systemctl stop docker
systemctl disable docker
/usr/sbin/ntpdate pool.ntp.org
cat >> /var/spool/cron/root << EOF
#time sync by gwl
*/10 * * * * /usr/sbin/ntpdate pool.ntp.org >/dev/null 2>&1
EOF
crontab -l

浙公网安备 33010602011771号