better way to select process and better error info. close #445

This commit is contained in:
hengyunabc committed 2019-02-13 20:52:48 +08:00
1 parent f6d2c9eb7c
commit 1cec77997f
3 files changed
+21 -12

No files matched your search

+4 -4
View File
@@ -635,14 +635,14 @@ parse_arguments()
# check the process already using telnet port if equals to target pid
if [[ ($telnetPortPid) && ($TARGET_PID != $telnetPortPid) ]]; then
echo "[ERROR] Target process $TARGET_PID is not the process using port $TELNET_PORT, you will connect to an unexpected process."
echo "[ERROR] If you still want to attach target process $TARGET_PID, Try to set a different telnet port by using --telnet-port argument."
echo "[ERROR] Or try to shutdown the process $telnetPortPid using the telnet port first."
echo "[ERROR] 1. Try to restart as.sh, select process $telnetPortPid, shutdown it first."
echo "[ERROR] 2. Try to use different telnet port, for example: as.sh --telnet-port 9998 --http-port -1"
exit 1
fi
if [[ ($httpPortPid) && ($TARGET_PID != $httpPortPid) ]]; then
echo "Target process $TARGET_PID is not the process using port $HTTP_PORT, you will connect to an unexpected process."
echo "If you still want to attach target process $TARGET_PID, Try to set a different telnet port by using --telnet-port argument."
echo "Or try to shutdown the process $httpPortPid using the telnet port first."
echo "1. Try to restart as.sh, select process $httpPortPid, shutdown it first."
echo "2. Try to use different http port, for example: as.sh --telnet-port 9998 --http-port 9999"
exit 1
fi
elif [ -z ${TARGET_PID} ]; then