#!/bin/sh
SERVERS="192.168.199.131 192.168.199.132 192.168.199.134 192.168.199.135 192.168.199.136" PASSWORD=redhat username=root for SERVER in $SERVERS do echo "++++++++++++++++++++++++++"$SERVER $PASSWORD scp /etc/yum.repos.d/CentOS7-Base-163.repo root@$SERVER:/etc/yum.repos.d/ scp /home/xiaoxu/software/* root@$SERVER:/home/xiaoxu/software/ ssh $SERVER "rpm -e yum-Metadata-parser-1.1.4-10.el7.x86_64 --nodeps;rpm -e yum-3.4.3-118.el7.noarch --nodeps;rpm -e yum-rhn-plugin-2.0 .1-4.el7.noarch --nodeps;rpm -e python-urlgrabber-3.10-8.el7.noarch --nodeps;mkdir -p /home/xiaoxu/software;cd /home/xiaoxu/software;us eradd kvidal;groupadd skvidal;rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm;rpm -ivh --force --nodeps yum-*;yum clean all;yum makec ache;" done 原文链接:https://www.f2er.com/bash/390422.html