Browse Source

增加功能 Shadowsocks 和 V2Ray 配置显示二维码

hongwenjun 6 years ago
parent
commit
e0b72075c8
2 changed files with 21 additions and 0 deletions
  1. 17 0
      v2ray_ss_conf.sh
  2. 4 0
      vps.sh

+ 17 - 0
v2ray_ss_conf.sh

@@ -25,6 +25,10 @@ setport(){
 }
 
 conf_shadowsocks(){
+    if [ ! -e '/etc/rc.local' ]; then
+        bash <(curl -L -s https://git.io/wgmtu)
+    fi
+
     old_ss_port=$(cat /etc/rc.local | grep ss-server | awk '{print $5}')
     ss_passwd=$(cat /etc/rc.local | grep ss-server | awk '{print $7}')
 
@@ -37,6 +41,10 @@ conf_shadowsocks(){
 }
 
 conf_v2ray(){
+    if [ ! -e '/etc/v2ray/config.json' ]; then
+        bash <(curl -L -s https://install.direct/go.sh)
+    fi
+
 # vmess://<<base64_v2ray_vmess.json>>
 cat <<EOF | tee ${cur_dir}/base64_v2ray_vmess.json
 {
@@ -153,6 +161,15 @@ echo_Yellow(){
 
 # 显示手机客户端二维码
 conf_QRcode(){
+
+    # 安装二维码插件
+    if [ ! -e '/usr/bin/qrencode' ]; then
+        apt -y install qrencode
+    fi
+    if [ ! -e '/usr/bin/qrencode' ]; then
+        yum -y install qrencode
+    fi
+
      ss_b64=$(base64 ${cur_dir}/base64_shadowsocks.conf)
      shadowsocks_ss="ss://${ss_b64}"
 

+ 4 - 0
vps.sh

@@ -39,6 +39,7 @@ start_menu(){
     echo_SkyBlue ">  4. 卸载 WireGuard Shadowsocks V2ray 服务"
     echo_SkyBlue ">  5. 显示 WireGuard V2ray 和 rc.local 配置"
     echo_SkyBlue ">  6. 退出"
+    ececho_SkyBlue ">  8. ${GreenBG} Shadowsocks 和 V2Ray 配置显示二维码 "
     read -p "请输入数字:" num
     case "$num" in
         1)
@@ -60,6 +61,9 @@ start_menu(){
         6)
         exit 1
         ;;
+        8)
+        bash <(curl -L -s https://raw.githubusercontent.com/hongwenjun/vps_setup/master/v2ray_ss_conf.sh)
+        ;;
         *)
         default_install
         ;;