From 2ec09d3e729e614769b71760391e5bd749c2a5bb Mon Sep 17 00:00:00 2001 From: 11617 <1161733918@qq.com> Date: Sun, 5 Mar 2023 21:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/get-os-init.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/os/get-os-init.sh b/os/get-os-init.sh index c48e61b..ff93f43 100644 --- a/os/get-os-init.sh +++ b/os/get-os-init.sh @@ -1,6 +1,8 @@ #!/usr/bin/bash #set -e + +yum_host=192.168.96.197 color(){ unset c declare -A c=([Error]=31 [Success]=32 [Warning]=33 [Info]=34) @@ -34,7 +36,7 @@ DNS2=114.114.114.114 DNS3=8.8.8.8 EOF systemctl restart network -ping -w1 -c1 www.baidu.com &>/dev/null && \ +ping -w2 -c2 www.baidu.com &>/dev/null && \ return 10 || \ return 20 } @@ -42,13 +44,13 @@ return 20 local_yum_make(){ cd /etc/yum.repos.d/ && \ rename .repo .repo.bak *.repo &>/dev/null - grep '10.8.161.40 package.qf.com' /etc/hosts &>/dev/null + grep "$yum_host package.qf.com" /etc/hosts &>/dev/null if [ $? -ne 0 ];then cat >> /etc/hosts <