summarylogtreecommitdiffstats
path: root/screamingfrogseospider
blob: b06ba7012587368ce0d9b967524a6b4a064646c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash

JAR="/usr/share/screamingfrogseospider/ScreamingFrogSEOSpider.jar"
if [ -f /usr/share/screamingfrogseospider/jre/bin/java ]; then
    JAVA_PATH="/usr/share/screamingfrogseospider/jre/bin/java"
elif [ -f /usr/lib/jvm/java-24-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-24-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-23-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-23-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-22-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-22-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-21-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-21-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-20-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-20-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-19-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-19-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-18-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-18-openjdk/bin/java"
elif [ -f /usr/lib/jvm/java-17-openjdk/bin/java ]; then
    JAVA_PATH="/usr/lib/jvm/java-17-openjdk/bin/java"
elif [ -f /usr/bin/java ]; then
    echo "Warning, falling back to java at /usr/bin/java if you have issues, check which version you are using\n"
    JAVA_PATH="/usr/bin/java"
else
    echo "Could not find java\n"
    exit 1
fi

FILE=$HOME/.screamingfrogseospider
if [ ! -f $FILE ]; then
    if [ $(uname -m) == 'x86_64' ]; then
        echo "-Xmx2g" >> $FILE
    else
        echo "-Xmx1024M" >> $FILE
    fi
fi

unset _JAVA_OPTIONS
JVM_ARGS=`cat $FILE`

exec ${JAVA_PATH} \
    $JVM_ARGS \
    -XX:+UseG1GC \
    -XX:+UseStringDeduplication \
    -enableassertions \
    -XX:ErrorFile=$HOME/.ScreamingFrogSEOSpider/hs_err_pid%p.log \
    -Djava.net.preferIPv4Stack=true \
    -Dscreamingfrog.platform=deb \
    -jar $JAR \
    "$@"