debian: 使用 cloudflare 判断是否国内

This commit is contained in:
bin456789 2023-07-22 21:45:47 +08:00
parent 382feb49c7
commit 990a8d4855
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -1,3 +1,4 @@
# https://www.debian.org/releases/stable/amd64/apbs04.zh-cn.html
# B.4.1. 本地化
d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
@ -59,7 +60,7 @@ d-i finish-install/reboot_in_progress note
# B.5.1. 安装过程中运行用户命令
d-i preseed/early_command string \
wget https://geoip.fedoraproject.org/city -O - | grep -w CHN && hostname=ftp.cn.debian.org || hostname=deb.debian.org; \
wget http://www.cloudflare.com/cdn-cgi/trace -O- | grep -x 'loc=CN' && hostname=ftp.cn.debian.org || hostname=deb.debian.org; \
debconf-set mirror/http/hostname $hostname
d-i partman/early_command string \