From 5871d57acb96c81e1a22c4c7362a4d549d4488a7 Mon Sep 17 00:00:00 2001 From: 233boy Date: Sun, 25 Nov 2018 11:39:45 +0800 Subject: [PATCH] sync time: v2ray time --- install.sh | 7 ++++--- v2ray.sh | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 1cd7f00..69efe54 100644 --- a/install.sh +++ b/install.sh @@ -872,13 +872,14 @@ install_v2ray() { # $cmd install -y lrzsz git zip unzip curl wget qrencode bind-utils iptables-services # fi if [[ $cmd == "apt-get" ]]; then - $cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin ntpdate + $cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin else - $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services ntpdate + $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services fi ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [ -d /etc/v2ray ] && rm -rf /etc/v2ray - ntpdate -u cn.pool.ntp.org + #sync time.. + date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z" if [[ $local_install ]]; then if [[ ! -d $(pwd)/config ]]; then diff --git a/v2ray.sh b/v2ray.sh index e2954c0..5817478 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v2.45" +_version="v2.46" cmd="apt-get" @@ -3793,6 +3793,9 @@ reload) view_v2ray_config_info download_v2ray_config_ask ;; +time) + date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z" + ;; log) view_v2ray_log ;;