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 <