diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32bbaab --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea +hosts.txt +hosts.json +index.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..e69de29 diff --git a/fetch_hosts.php b/fetch_hosts.php new file mode 100644 index 0000000..93f4330 --- /dev/null +++ b/fetch_hosts.php @@ -0,0 +1,71 @@ +', $utc_date, $template)); +hosts_write('hosts.txt', $hosts_content); +hosts_write('hosts.json', json_encode($github_hosts)); + +echo "fetch success! ($utc_date)"; + + + + + diff --git a/index-template.php b/index-template.php new file mode 100644 index 0000000..e826859 --- /dev/null +++ b/index-template.php @@ -0,0 +1,35 @@ + + +
+ + + +最近获取时间: + + + + + [hosts.txt] + [hosts.json] +
+sed -i "/# fetch-github-host begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts
+提示:可以设置定时任务定时获取更新即可
+https://hosts.gitcdn.top/hosts.txt
+