From 2f23baa6295b6b10380f4413019a533f2458e1d5 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 14 Dec 2022 17:40:51 +0800 Subject: [PATCH] check time synchronize --- script/env_check.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/env_check.sh b/script/env_check.sh index b4af71d95..f51dca451 100644 --- a/script/env_check.sh +++ b/script/env_check.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash source ./style_info.cfg -echo -e "check time synchronize................................" +echo -e "check time synchronize.................................." t=`curl http://time.akamai.com/?iso -s` t1=`date -d $t +%s` t2=`date +%s` let between=t2-t1 -if [[ $between > 10 ]] || [[ $between < -10 ]]; then +if [[ $between -gt 10 ]] || [[ $between -lt -10 ]]; then echo -e ${RED_PREFIX}"Warning: The difference between the iso time and the server's time is too large: "$between"s" ${COLOR_SUFFIX} else echo -e ${GREEN_PREFIX} "ok: Server time is synchronized " ${COLOR_SUFFIX}