mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-14 06:45:19 +00:00
fix:#62
This commit is contained in:
1 parent
80a30351d3
commit
2526b84d97
1 file changed
+11
-27
@@ -413,34 +413,18 @@ active_console()
|
||||
local arthas_version=$1
|
||||
local arthas_lib_dir=${ARTHAS_LIB_DIR}/${arthas_version}/arthas
|
||||
|
||||
if [[ "${arthas_version}" > "3.0" ]]; then
|
||||
if [ "${BATCH_MODE}" = "true" ]; then
|
||||
${JAVA_HOME}/bin/java ${ARTHAS_OPTS} ${JVM_OPTS} \
|
||||
-jar ${arthas_lib_dir}/arthas-client.jar \
|
||||
${TARGET_IP} \
|
||||
-p ${TELNET_PORT} \
|
||||
-f ${BATCH_SCRIPT}
|
||||
elif type telnet 2>&1 >> /dev/null; then
|
||||
# use telnet
|
||||
telnet ${TARGET_IP} ${TELNET_PORT}
|
||||
else
|
||||
echo "'telnet' is required." 1>&2
|
||||
return 1
|
||||
fi
|
||||
if [ "${BATCH_MODE}" = "true" ]; then
|
||||
${JAVA_HOME}/bin/java ${ARTHAS_OPTS} ${JVM_OPTS} \
|
||||
-jar ${arthas_lib_dir}/arthas-client.jar \
|
||||
${TARGET_IP} \
|
||||
-p ${TELNET_PORT} \
|
||||
-f ${BATCH_SCRIPT}
|
||||
elif type telnet 2>&1 >> /dev/null; then
|
||||
# use telnet
|
||||
telnet ${TARGET_IP} ${TELNET_PORT}
|
||||
else
|
||||
# for compatibility
|
||||
# use default console
|
||||
ARGS="${TARGET_IP} ${TELNET_PORT}"
|
||||
if [ ${BATCH_MODE} = true ]; then
|
||||
ARGS="$ARGS -b"
|
||||
fi
|
||||
if [ ! -z ${BATCH_SCRIPT} ]; then
|
||||
ARGS="$ARGS -f $BATCH_SCRIPT"
|
||||
fi
|
||||
eval ${JAVA_HOME}/bin/java ${ARTHAS_OPTS} \
|
||||
-cp ${arthas_lib_dir}/arthas-core.jar \
|
||||
com.taobao.arthas.core.ArthasConsole \
|
||||
${ARGS}
|
||||
echo "'telnet' is required." 1>&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user