diff --git a/README.md b/README.md index e5a1a62..6896bb3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## 使用方法 ### Unix/Linux ```shell -sed -i "/# fetch-github-host begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts +sed -i "/# fetch-github-hosts begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts ``` > 提示:可以设置定时任务定时获取更新即可 diff --git a/fetch_hosts.php b/fetch_hosts.php index 56eba61..93948d9 100644 --- a/fetch_hosts.php +++ b/fetch_hosts.php @@ -41,14 +41,14 @@ ]; $github_hosts = []; -$hosts_content = "# fetch-github-host begin\n"; +$hosts_content = "# fetch-github-hosts begin\n"; foreach ($github_urls as $url) { $item = [gethostbyname($url), $url]; $github_hosts[] = $item; $hosts_content .= str_pad($item[0], 28) . $item[1] . "\n"; } $utc_date = date('c'); -$hosts_content .= "# last fetch time: $utc_date\n# update url: https://hosts.gitcdn.top/hosts.txt\n# fetch-github-host end\n\n"; +$hosts_content .= "# last fetch time: $utc_date\n# update url: https://hosts.gitcdn.top/hosts.txt\n# fetch-github-hosts end\n\n"; $template = file_get_contents('index-template.php'); file_put_contents('index.php', str_replace('', $utc_date, $template));