|
|
@ -126,7 +126,32 @@ _load() { |
|
|
|
local _dir="/etc/v2ray/233boy/v2ray/src/" |
|
|
|
local _dir="/etc/v2ray/233boy/v2ray/src/" |
|
|
|
. "${_dir}$@" |
|
|
|
. "${_dir}$@" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
_sys_timezone() { |
|
|
|
|
|
|
|
IS_OPENVZ= |
|
|
|
|
|
|
|
if hostnamectl status | grep -q openvz; then |
|
|
|
|
|
|
|
IS_OPENVZ=1 |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
timedatectl set-timezone Asia/Shanghai |
|
|
|
|
|
|
|
timedatectl set-ntp true |
|
|
|
|
|
|
|
echo "已将你的主机设置为Asia/Shanghai时区并通过systemd-timesyncd自动同步时间。" |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ $IS_OPENVZ ]]; then |
|
|
|
|
|
|
|
echo |
|
|
|
|
|
|
|
echo -e "你的主机环境为 ${yellow}Openvz${none} ,建议使用${yellow}v2ray mkcp${none}系列协议。" |
|
|
|
|
|
|
|
echo -e "注意:${yellow}Openvz${none} 系统时间无法由虚拟机内程序控制同步。" |
|
|
|
|
|
|
|
echo -e "如果主机时间跟实际相差${yellow}超过90秒${none},v2ray将无法正常通信,请发ticket联系vps主机商调整。" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_sys_time() { |
|
|
|
|
|
|
|
echo -e "\n主机时间:${yellow}" |
|
|
|
|
|
|
|
timedatectl status | sed -n '1p;4p' |
|
|
|
|
|
|
|
echo -e "${none}" |
|
|
|
|
|
|
|
[[ $IS_OPENV ]] && pause |
|
|
|
|
|
|
|
} |
|
|
|
v2ray_config() { |
|
|
|
v2ray_config() { |
|
|
|
# clear |
|
|
|
# clear |
|
|
|
echo |
|
|
|
echo |
|
|
@ -754,14 +779,16 @@ caddy_config() { |
|
|
|
install_v2ray() { |
|
|
|
install_v2ray() { |
|
|
|
$cmd update -y |
|
|
|
$cmd update -y |
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
if [[ $cmd == "apt-get" ]]; then |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap2-bin dbus |
|
|
|
else |
|
|
|
else |
|
|
|
# $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services |
|
|
|
# $cmd install -y lrzsz git zip unzip curl wget qrencode libcap iptables-services |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap |
|
|
|
$cmd install -y lrzsz git zip unzip curl wget qrencode libcap |
|
|
|
fi |
|
|
|
fi |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
|
|
|
[ -d /etc/v2ray ] && rm -rf /etc/v2ray |
|
|
|
[ -d /etc/v2ray ] && rm -rf /etc/v2ray |
|
|
|
date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z" |
|
|
|
# date -s "$(curl -sI g.cn | grep Date | cut -d' ' -f3-6)Z" |
|
|
|
|
|
|
|
_sys_timezone |
|
|
|
|
|
|
|
_sys_time |
|
|
|
|
|
|
|
|
|
|
|
if [[ $local_install ]]; then |
|
|
|
if [[ $local_install ]]; then |
|
|
|
if [[ ! -d $(pwd)/config ]]; then |
|
|
|
if [[ ! -d $(pwd)/config ]]; then |
|
|
|