summarylogtreecommitdiffstats
path: root/main.install
blob: 111ffdaf8738fe6a576ec66e8832acd2561d2aa9 (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
post_install() {
    serverDir=/etc/connective-http
    classPathFolders=( "libs/" )
    mainType=org.asf.connective.standalone.main.ConnectiveStandalone
    credtoolLibs=()
    credtoolTarget=""
    jvmArguments="-Djava.net.preferIPv4Stack=true"

    if [ -f "/etc/connective-http/config.props" ]; then
        source "/etc/connective-http/config.props"
    fi

    cp "/usr/lib/salted/.credtool.target" "$serverDir" -f
    chown connective "$serverDir/.credtool.target"
    
    mkdir "$serverDir/modules" -p
    chown connective:connective "$serverDir/modules" -R
    ln -sf "/usr/lib/salted/SaltedAuth.jar" "$serverDir/modules/SaltedAuth.jar"
    chown connective "$serverDir/modules/SaltedAuth.jar"
       
    if [ -f "$serverDir"/server.ccfg ]; then
        cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .modules.UserManager &>/dev/null && cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg . -s modules.UserManager.authentication-backend salted --ccfg-output --output "$serverDir"/server.ccfg
    fi
}

post_upgrade() {
    serverDir=/etc/connective-http
    classPathFolders=( "libs/" )
    mainType=org.asf.connective.standalone.main.ConnectiveStandalone
    credtoolLibs=()
    credtoolTarget=""
    jvmArguments="-Djava.net.preferIPv4Stack=true"

    if [ -f "/etc/connective-http/config.props" ]; then
        source "/etc/connective-http/config.props"
    fi
    
    mkdir "$serverDir/modules" -p
    chown connective:connective "$serverDir/modules" -R
    ln -sf "/usr/lib/salted/SaltedAuth.jar" "$serverDir/modules/SaltedAuth.jar"
    chown connective "$serverDir/modules/SaltedAuth.jar"
}

post_remove() {
    serverDir=/etc/connective-http
    classPathFolders=( "libs/" )
    mainType=org.asf.connective.standalone.main.ConnectiveStandalone
    credtoolLibs=()
    credtoolTarget=""
    jvmArguments="-Djava.net.preferIPv4Stack=true"

    if [ -f "/etc/connective-http/config.props" ]; then
        source "/etc/connective-http/config.props"
    fi

    rm -f "$serverDir/.credtool.target"
    rm -f "$serverDir/modules/SaltedAuth.jar"
    
    if [ -f "$serverDir"/server.ccfg ]; then
        cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg .modules.UserManager &>/dev/null && cq org.asf.connective.standalone.main.ConnectiveConfiguration --source-jar /usr/lib/connective-http/ConnectiveStandalone.jar --source-jar /usr/lib/connective-http/libs/RatsMemory.jar "$serverDir"/server.ccfg . -s modules.UserManager.authentication-backend credtool --ccfg-output --output "$serverDir"/server.ccfg
    fi
}