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_version=$1
|
||||||
local arthas_lib_dir=${ARTHAS_LIB_DIR}/${arthas_version}/arthas
|
local arthas_lib_dir=${ARTHAS_LIB_DIR}/${arthas_version}/arthas
|
||||||
|
|
||||||
if [[ "${arthas_version}" > "3.0" ]]; then
|
if [ "${BATCH_MODE}" = "true" ]; then
|
||||||
if [ "${BATCH_MODE}" = "true" ]; then
|
${JAVA_HOME}/bin/java ${ARTHAS_OPTS} ${JVM_OPTS} \
|
||||||
${JAVA_HOME}/bin/java ${ARTHAS_OPTS} ${JVM_OPTS} \
|
-jar ${arthas_lib_dir}/arthas-client.jar \
|
||||||
-jar ${arthas_lib_dir}/arthas-client.jar \
|
${TARGET_IP} \
|
||||||
${TARGET_IP} \
|
-p ${TELNET_PORT} \
|
||||||
-p ${TELNET_PORT} \
|
-f ${BATCH_SCRIPT}
|
||||||
-f ${BATCH_SCRIPT}
|
elif type telnet 2>&1 >> /dev/null; then
|
||||||
elif type telnet 2>&1 >> /dev/null; then
|
# use telnet
|
||||||
# use telnet
|
telnet ${TARGET_IP} ${TELNET_PORT}
|
||||||
telnet ${TARGET_IP} ${TELNET_PORT}
|
|
||||||
else
|
|
||||||
echo "'telnet' is required." 1>&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
# for compatibility
|
echo "'telnet' is required." 1>&2
|
||||||
# use default console
|
return 1
|
||||||
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}
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user