From 949028668eb73d5d327eb62dfefe3244cb55762d Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Mon, 28 Dec 2020 11:13:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=9A=E6=9C=AC):=20=E4=BF=AE=E6=94=B9pa?= =?UTF-8?q?th=E7=9A=84=E6=88=AA=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo.sh | 4 ++++ install.sh | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100755 demo.sh diff --git a/demo.sh b/demo.sh new file mode 100755 index 0000000..36b954f --- /dev/null +++ b/demo.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +str="abcdefg" +echo ${str:0-2:4} \ No newline at end of file diff --git a/install.sh b/install.sh index 1c6b149..2d4ec8b 100644 --- a/install.sh +++ b/install.sh @@ -185,10 +185,15 @@ readConfigHostPathUUID(){ local path=`cat ${configPath}02_VLESS_TCP_inbounds.json|jq .inbounds[0].settings.fallbacks|jq -c '.[].path'|awk -F "[\"][/]" '{print $2}'|awk -F "[\"]" '{print $1}'|tail -n +2|head -n 1` if [[ ! -z "${path}" ]] then - currentPath=${path:0:4} + if [[ `echo ${path:0-2}` = "ws" ]] + then + currentPath=`echo ${path}|awk -F "[w][s]" '{print $1}'` + elif [[ `echo ${path:0-2}` = "tcp" ]] + then + currentPath=`echo ${path}|awk -F "[t][c][p]" '{print $1}'` + fi fi fi - if [[ "${coreInstallType}" = "1" ]] then currentHost=`cat ${configPath}02_VLESS_TCP_inbounds.json|jq .inbounds[0].streamSettings.xtlsSettings.certificates[0].certificateFile|awk -F '[t][l][s][/]' '{print $2}'|awk -F '["]' '{print $1}'|awk -F '[.][c][r][t]' '{print $1}'`