linux初始化shell脚本

匿名 (未验证) 提交于 2019-12-02 21:56:30
#!/bin/bash # this is a init script ping -c 1 -i 0.1 -W 1 baidu.com a=`echo $?` if [ ${a} == 0 ];then     echo "network success" else     echo "network failer"     exit 2 fi systemctl stop firewalld systemctl disable  firewalld sed -i 's/^SELINUX=enforcing/SELINUX=disable/' /etc/selinux/config hn=master1.localdomain hostnamectl set-hostname ${hn} yum install -y wget 2>&1 # ----------------------------- 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.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo b=`echo $?` if [ ${b} == 0 ];then      echo "yum 替换成功" else     echo "yum 替换失败,将手动执行下列过程"     exit 2 fi yum clean all;yum makecache reboot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!