aboutsummarylogtreecommitdiffstats
path: root/jboss-forge-offline.install
blob: 7f215a361e0e87398adec3d5d37f37f64104c46e (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65

pre_remove()
{
    echo "Running forge pre_remove script..."

    if [ -d /opt/jboss/forge ]; then
        echo "Removing your existing Forge installation."
    fi

    rm -rf /opt/jboss/forge
    rm /usr/bin/forge

}

pre_upgrade() {
    pre_remove
}

post_upgrade() {
    post_install
}

post_install() {

    echo "Running forge post_install script..."

    ln -s /opt/jboss/forge/bin/forge /usr/bin/forge


#Java Check
if type -p java; then
    _java=java
elif [ -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then   
    _java="$JAVA_HOME/bin/java"
else
    echo "Java not installed . Please install java. Aborting"
    exit 1
fi

if [ "$_java" ]; then
    version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
    if [ "$version" \< "1.7" ]; then           
        echo "JDK Version is less than 1.7 . Forge requires JDK 7+ . Aborting."
        exit 1
    fi
fi

cat <<EOF

To get started fast:
run forge
localhost:~ $ forge
[~] $

If you have not yet seen the Forge built-in commands, you may either press TAB to see a list of the currently available commands, or get a more descriptive list by typing:

$ command-list

Then to get started - see the docs at
http://forge.jboss.org/documentation 
Consider installing Git and Maven 3.1+ (both optional)

EOF

}