Update modify_time.sh

This commit is contained in:
spiritLHLS 2022-12-17 19:19:16 +08:00 committed by GitHub
parent 12badeca95
commit d756a00edc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ else
sudo apt-get update
sudo apt-get install ntpdate -y
fi
sudo ntpdate -u time.nist.gov
sudo ntpdate -u time.nist.gov || sudo ntpdate pool.ntp.org || sudo ntpdate cn.pool.ntp.org
elif [ "$OS" == "CentOS/Fedora" ]; then
# CentOS/Fedora 系统使用 ntpdate 命令
if [ ! -x "$(command -v ntpdate)" ]; then
@ -55,7 +55,7 @@ else
sudo yum update
sudo yum install ntpdate -y
fi
sudo ntpdate time.nist.gov
sudo ntpdate time.nist.gov || sudo ntpdate pool.ntp.org || sudo ntpdate cn.pool.ntp.org
else
# 未知系统
echo "Unable to adjust system time on unknown system."