浏览代码

switch update.sh/check_online_status() from ping to curl to make it proxy ready

thomas 2 年之前
父节点
当前提交
a6a7ab45f8
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      update.sh

+ 3 - 3
update.sh

@@ -3,9 +3,9 @@
 ############## Begin Function Section ##############
 
 check_online_status() {
-  CHECK_ONLINE_IPS=(1.1.1.1 9.9.9.9 8.8.8.8)
-  for ip in "${CHECK_ONLINE_IPS[@]}"; do
-    if timeout 3 ping -c 1 ${ip} > /dev/null; then
+  CHECK_ONLINE_DOMAINS=('https://github.com')
+  for domain in "${CHECK_ONLINE_DOMAINS[@]}"; do
+    if timeout 3 curl --head --silent --output /dev/null ${domain}; then
       return 0
     fi
   done