From dd2ea706904ee95acf483582dacd10139674487b Mon Sep 17 00:00:00 2001 From: 233boy Date: Thu, 22 Feb 2018 15:28:23 +0800 Subject: [PATCH] add local install args --- install.sh | 35 ++++++++++++++++++++++++++++++++++- v2ray.sh | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 5bcca8f..62313c5 100644 --- a/install.sh +++ b/install.sh @@ -695,7 +695,12 @@ install_v2ray() { rm -rf /tmp/v2ray - git clone https://github.com/233boy/v2ray /etc/v2ray/233boy/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 @@ -1660,6 +1665,30 @@ uninstall() { fi } + +args=$1 +[ -z $1 ] && args="online" +case $args in +online) + #hello world + ;; +local) + local_install=true + ;; +*) + echo + echo -e " 大佬...你输入的这个参数 <$red $args $none> ...这个是什么鬼啊...脚本不认识它哇" + echo + echo -e " 这个辣鸡脚本仅支持输入$green local / online $none参数" + echo + echo -e " 输入$yellow local $none即是使用本地安装" + echo + echo -e " 输入$yellow online $none即是使用在线安装 (默认)" + echo + exit 1 + ;; +esac + clear while :; do echo @@ -1673,6 +1702,10 @@ while :; do echo echo " 2. 卸载" echo + if [[ $local_install ]]; then + echo " 温馨提示.. 本地安装已启用 .." + echo + fi read -p "$(echo -e "请选择 [${magenta}1-2$none]:")" choose case $choose in 1) diff --git a/v2ray.sh b/v2ray.sh index 1735c51..cb862f5 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="v1.32" +_version="v1.40" cmd="apt-get"