base-files: tweak default ntp servers

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 63138ba4314dc12bbfd15b64e064505d51fcb0ed)
This commit is contained in:
Tianling Shen 2021-07-16 15:53:30 +08:00
parent 5ef4b8e1de
commit 84221380ca
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 14 additions and 6 deletions

View File

@ -311,10 +311,10 @@ generate_static_system() {
set system.ntp='timeserver'
set system.ntp.enabled='1'
set system.ntp.enable_server='0'
add_list system.ntp.server='ntp1.aliyun.com'
add_list system.ntp.server='time1.cloud.tencent.com'
add_list system.ntp.server='time.ustc.edu.cn'
add_list system.ntp.server='time1.google.com'
add_list system.ntp.server='time1.apple.com'
add_list system.ntp.server='0.openwrt.pool.ntp.org'
add_list system.ntp.server='1.openwrt.pool.ntp.org'
EOF
if json_is_a system object; then

View File

@ -1,9 +1,17 @@
#!/bin/sh
uci set system.@system[0].timezone=CST-8
uci set system.@system[0].zonename=Asia/Shanghai
uci -q batch <<-EOF
set system.@system[0].timezone='CST-8'
set system.@system[0].zonename='Asia/Shanghai'
delete system.ntp.server
add_list system.ntp.server='cn.ntp.org.cn'
add_list system.ntp.server='ntp.ntsc.ac.cn'
add_list system.ntp.server='time1.cloud.tencent.com'
add_list system.ntp.server='time1.aliyun.com'
EOF
uci commit system
sed -i 's#https://downloads.openwrt.org#https://mirrors.tencent.com/lede#g' /etc/opkg/distfeeds.conf
sed -i 's,downloads.openwrt.org,mirrors.tencent.com/lede,g' /etc/opkg/distfeeds.conf
exit 0