标签:make title conf too 主机 oss script 自己 直接
自己总结了一些简单的centos7上的初始化配置和脚本,方便克隆使用1.修改网卡地址软连接
ln -s /etc/sysconfig/network-scripts/ifcfg-eth0 /root/network
使用network软连接到网卡信息配置文件上,方便直接修改网卡信息
使用的时候直接边界network软连接
2.主机名修改
编写脚本名称hostname.sh,方便直接修改主机名
#!/bin/bash # hostname.sh hostnamectl --static sethostname $1
3.更新yum脚本
编写脚本,运行直接更新为阿里云yum源
#!/bin/bash #change yum source #name=yum.sh echo "========start=============" cd /etc/yum.repos.d/ echo "====dowload tools=========" yum install -y net-tools vim wget echo "====backup repo===========" mv CentOS-Base.repo CentOS-Base.repo.bak echo "====dowload aliyum-repo====" wget http://mirrors.aliyun.com/repo/Centos-7.repo echo "====upgrade aliyum-repo====" mv Centos-7.repo CentOS-Base.repo echo "====upgrade yum============" yum clean all ange yum source echo "========start=============" cd /etc/yum.repos.d/ echo "====dowload tools=========" yum install -y net-tools vim wget echo "====backup repo===========" mv CentOS-Base.repo CentOS-Base.repo.bak echo "====dowload aliyum-repo====" wget http://mirrors.aliyun.com/repo/Centos-7.repo echo "====upgrade aliyum-repo====" mv Centos-7.repo CentOS-Base.repo echo "====upgrade yum============" yum clean all yum makecache yum update -y echo "========start=============" cd /etc/yum.repos.d/ echo "====dowload tools=========" yum install -y net-tools vim wget echo "====backup repo===========" mv CentOS-Base.repo CentOS-Base.repo.bak echo "====dowload aliyum-repo====" wget http://mirrors.aliyun.com/repo/Centos-7.repo echo "====upgrade aliyum-repo====" mv Centos-7.repo CentOS-Base.repo echo "====upgrade yum============" yum clean all yum makecache yum update -y yum makecache yum makecache yum update -y cd ~ echo "=========finish============"
标签:make title conf too 主机 oss script 自己 直接
原文地址:http://blog.51cto.com/11555417/2155036