apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.

Home Page:https://seata.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

seata-setup.sh脚本中JAVA_OPT判断代码问题

hdfk7 opened this issue · comments

https://github.com/apache/incubator-seata/releases/download/v2.0.0/seata-server-2.0.0.zip

以下代码是有问题的代码

JAVA_MAJOR_VERSION=$($JAVACMD -version 2>&1 | sed '1!d' | sed -e 's/"//g' | awk '{print $3}' | awk -F '.' '{print $1}')
if [[ "$JAVA_MAJOR_VERSION" -eq "1" ]] ; then
JAVA_MAJOR_VERSION=$($JAVACMD -version 2>&1 | sed '1!d' | sed -e 's/"//g' | awk '{print $3}' | awk -F '.' '{print $2}')
fi
if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] ; then
JAVA_OPT="${JAVA_OPT} -Xlog:gc*:file=${LOG_HOME}/seata_gc.log:time,tags:filecount=10,filesize=102400"
elif [[ "$JAVA_MAJOR_VERSION" -ge "17" ]] ; then
JAVA_OPT="${JAVA_OPT} -Xlog:gc=trace:file=${LOG_HOME}/seata_gc.log:time,tags:filecount=10,filesize=10M"
else
JAVA_OPT="${JAVA_OPT} -Xloggc:${LOG_HOME}/seata_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC"
fi

这里很简单的问题,if 条件写的有问题。