Skip to content

Commit 1649959

Browse files
committed
Fix $city always not work
1 parent 88dd91d commit 1649959

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

superbench.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ ip_info4() {
379379
org=$(python tools.py geoip org)
380380
countryCode=$(python tools.py ipip country_code)
381381
region=$(python tools.py ipip province)
382-
if [ !city ]; then
382+
if [ -z "$city" ]; then
383383
city=${region}
384384
fi
385385

@@ -540,13 +540,8 @@ print_end_time() {
540540
#echo $(date +%Y-%m-%d" "%H:%M:%S)
541541
printf '\n' | tee -a $log
542542
#utc_time=$(date -u '+%F %T')
543-
#bj_time=$(date +%Y-%m-%d" "%H:%M:%S -d '+8 hours')
544-
bj_time=$(curl -s http://cgi.im.qq.com/cgi-bin/cgi_svrtime)
545-
#utc_time=$(date +"$bj_time" -d '-8 hours')
543+
bj_time=$(TZ=Asia/Shanghai date +%Y-%m-%d" "%H:%M:%S)
546544

547-
if [[ $(echo $bj_time | grep "html") ]]; then
548-
bj_time=$(date -u +%Y-%m-%d" "%H:%M:%S -d '+8 hours')
549-
fi
550545
echo " Timestamp : $bj_time GMT+8" | tee -a $log
551546
#echo " Finished!"
552547
echo " Results : $log"

0 commit comments

Comments
 (0)