Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
233boy committed Apr 4, 2018
1 parent 5878357 commit b0f14a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
27 changes: 18 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ install_caddy() {
useradd -M -s /usr/sbin/nologin www-data
fi
chown -R www-data.www-data /etc/ssl/caddy

mkdir -p /etc/caddy/
rm -rf $caddy_tmp
caddy_config
Expand Down Expand Up @@ -775,6 +775,21 @@ install_v2ray() {
fi
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

if [[ $local_install ]]; then
if [[ ! -d $(pwd)/config ]]; then
echo
echo -e "$red 哎呀呀...安装失败了咯...$none"
echo
echo -e " 请确保你有完整的上传 233blog.com V2Ray 一键安装脚本 & 管理脚本到当前 ${green}$(pwd) $none目录下"
echo
exit 1
fi
mkdir -p /etc/v2ray/233boy/v2ray
cp -rf $(pwd)/* /etc/v2ray/233boy/v2ray
else
git clone https://github.com/233boy/v2ray /etc/v2ray/233boy/v2ray
fi

[ -d /tmp/v2ray ] && rm -rf /tmp/v2ray
mkdir -p /tmp/v2ray

Expand Down Expand Up @@ -810,12 +825,6 @@ install_v2ray() {

rm -rf /tmp/v2ray

if [[ $local_install ]]; then
mkdir -p /etc/v2ray/233boy/v2ray
cp -rf $(pwd)/* /etc/v2ray/233boy/v2ray
else
git clone https://github.com/233boy/v2ray /etc/v2ray/233boy/v2ray
fi

if [ $shadowsocks ]; then
if [[ $is_blocked_ad ]]; then
Expand Down Expand Up @@ -1602,7 +1611,7 @@ get_qr_link() {

}
install() {
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -f /lib/systemd/system/v2ray.service ]]; then
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
echo
echo " 大佬...你已经安装 V2Ray 啦...无需重新安装"
echo
Expand All @@ -1625,7 +1634,7 @@ install() {
}
uninstall() {

if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup ]]; then
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then
while :; do
echo
read -p "$(echo -e "是否卸载 ${yellow}V2Ray$none [${magenta}Y/N$none]:")" uninstall_v2ray_ask
Expand Down
4 changes: 2 additions & 2 deletions 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="v1.57"
_version="v1.58"

cmd="apt-get"

Expand Down Expand Up @@ -44,7 +44,7 @@ fi

backup="/etc/v2ray/233blog_v2ray_backup.txt"

if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup ]]; then
if [[ -f /usr/bin/v2ray/v2ray && -f /etc/v2ray/config.json ]] && [[ -f $backup && -d /etc/v2ray/233boy/v2ray ]]; then

v2ray_transport=$(sed -n '17p' $backup)
v2ray_port=$(sed -n '19p' $backup)
Expand Down

0 comments on commit b0f14a4

Please sign in to comment.