#!/bin/bash# this is a init scriptping -c 1 -i 0.1 -W 1 baidu.coma=`echo $?`if [ ${a} == 0 ];then echo "network success"else echo "network failer" exit 2fisystemctl stop firewalldsystemctl disable firewalldsed -i 's/^SELINUX=enforcing/SELINUX=disable/' /etc/selinux/confighn=master1.localdomainhostnamectl set-hostname ${hn}# -----------------------------mkdir /tmp/yum.repo.bak ;mv /etc/yum.repos.d/* /tmp/yum.repos.bak/wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repowget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repob=`echo $?`if [ ${b} == 0 ];then echo "yum 替换成功"else echo "yum 替换失败,将手动执行下列过程" exit 2fiyum clean all;yum makecache yum install -y wget vim 2>&1 reboot