Add -i|--stdin -d|--debug support

This commit is contained in:
Samuel Huang
2021-08-23 10:37:45 +10:00
parent f045a8d0b9
commit db75e7ec39
2 changed files with 13 additions and 10 deletions

13
run.sh
View File

@@ -19,10 +19,11 @@ usage() {
echo " --tttw <TROJAN-TCP-TLS-WS option> [p=443,]d=domain.com,u=passwd[:email][,f=[fallback-host]:fb-port:[fb-path]],w=/webpath"
# echo " --ssa <Shadowsocks-AEAD option> [port=443,]user=password1:method1[,user=password2:method2]"
# echo " --sst <Shadowsocks-TCP option> [port=443,]user=passwd,method=xxxx"
echo " --stdin Read XRay config from stdin instead of auto generation"
echo " -i|--stdin Read XRay config from stdin instead of auto generation"
echo " -d|--debug Start Xray in debug mode with verbose output"
}
TEMP=`getopt -o k:r:c:d --long hook:,request-domain:,cert-path:,ltx:,ltt:,lttw:,mtt:,mttw:,ttt:,tttw:,lttg:,ssa:,sst:stdin,debug -n "$0" -- $@`
TEMP=`getopt -o k:r:c:di --long hook:,request-domain:,cert-path:,ltx:,ltt:,lttw:,mtt:,mttw:,ttt:,tttw:,lttg:,ssa:,sst:stdin,debug -n "$0" -- $@`
if [ $? != 0 ] ; then usage; exit 1 ; fi
eval set -- "$TEMP"
@@ -40,6 +41,10 @@ while true ; do
CERTPATH+="$2"
shift 2
;;
-i|--stdin)
STDINCONF=1
shift 1
;;
-d|--debug)
DEBUG=1
shift 1
@@ -49,10 +54,6 @@ while true ; do
SVC=`echo $1|tr -d '\-\-'`
SVCMD+=("${DIR}server-${SVC}.sh $2")
shift 2
;;
--stdin)
STDINCONF=1
shift 2
;;
--)
shift