Skip to content

Commit

Permalink
sync time: v2ray time
Browse files Browse the repository at this point in the history
  • Loading branch information
233boy committed Nov 25, 2018
1 parent b361a42 commit 5871d57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion v2ray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
;;
Expand Down

0 comments on commit 5871d57

Please sign in to comment.