This commit is contained in:
GuoHao 2019-03-19 11:28:18 +08:00 committed by hengyunabc
parent 6a3aa5cb91
commit 445e8141bd
3 changed files with 8 additions and 8 deletions

View File

@ -100,7 +100,7 @@ public class AgentBootstrap {
args = decodeArg(args);
int index = args.indexOf(';');
String agentJar = args.substring(0, index);
final String agentArgs = args.substring(index, args.length());
final String agentArgs = args.substring(index);
File agentJarFile = new File(agentJar);
if (!agentJarFile.exists()) {

View File

@ -22,9 +22,9 @@ exit_on_err()
}
# check permission to download && install
[ ! -w ./ ] && exit_on_err 1 "permission denied, target directory ./ was not writable."
[[ ! -w ./ ]] && exit_on_err 1 "permission denied, target directory ./ was not writable."
if [ $# -gt 1 ] && [ $1 = "--url" ]; then
if [[ $# -gt 1 ]] && [[ $1 = "--url" ]]; then
shift
ARTHAS_FILE_URL=$1
shift
@ -35,14 +35,14 @@ echo "downloading... ${TEMP_ARTHAS_FILE}"
curl \
-sLk \
--connect-timeout ${SO_TIMEOUT} \
$ARTHAS_FILE_URL \
${ARTHAS_FILE_URL} \
-o ${TEMP_ARTHAS_FILE} \
|| exit_on_err 1 "download failed!"
# wirte or overwrite local file
# write or overwrite local file
rm -rf as.sh
mv ${TEMP_ARTHAS_FILE} ${TARGET_ARTHAS_FILE}
chmod +x ${TARGET_ARTHAS_FILE}
# done
echo "Arthas install successed."
echo "Arthas install succeeded."

View File

@ -76,7 +76,7 @@ public class Bootstrap {
* <pre>
* The directory contains arthas-core.jar/arthas-client.jar/arthas-spy.jar.
* 1. When use-version is not empty, try to find arthas home under ~/.arthas/lib
* 2. Try set the directory where arthas-boot.jar is located to arhtas home
* 2. Try set the directory where arthas-boot.jar is located to arthas home
* 3. Try to download from maven repo
* </pre>
*/
@ -524,7 +524,7 @@ public class Bootstrap {
private static void verifyArthasHome(String arthasHome) {
File home = new File(arthasHome);
if (home.isDirectory()) {
String fileList[] = { "arthas-core.jar", "arthas-agent.jar", "arthas-spy.jar" };
String[] fileList = { "arthas-core.jar", "arthas-agent.jar", "arthas-spy.jar" };
for (String fileName : fileList) {
if (!new File(home, fileName).exists()) {