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 mkdir "$serverDir/modules" -p chown connective:connective "$serverDir/modules" -R ln -sf "/usr/lib/customindexpages/CustomIndexPages.jar" "$serverDir/modules/CustomIndexPages.jar" chown connective "$serverDir/modules/CustomIndexPages.jar" if [ -f "$serverDir"/server.ccfg ] && 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 .context.root &>/dev/null; then cipsupportcode=' # Custom Index Pages Support Block (Auto-generated, avoid manual removal) defaultindexpage "class:org.asf.connective.customindexpages.CustomIndexPageProvider"' rootcontextblock="$(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 .context.root --viewmode | sed "0,/^..*/s||&\n${cipsupportcode//$'\n'/\\n}|" ; echo .)" rootcontextblock=${rootcontextblock:0:-2} 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 .context.root &>/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 .context.root "$rootcontextblock" --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/customindexpages/CustomIndexPages.jar" "$serverDir/modules/CustomIndexPages.jar" chown connective "$serverDir/modules/CustomIndexPages.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/modules/CustomIndexPages.jar" if [ -f "$serverDir"/server.ccfg ] && 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 .context.root &>/dev/null; then cipsupportcode=' # Custom Index Pages Support Block (Auto-generated, avoid manual removal) defaultindexpage "class:org.asf.connective.customindexpages.CustomIndexPageProvider"' rootcontextblock="$(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 .context.root --viewmode ; echo .)" rootcontextblock="${rootcontextblock//$cipsupportcode$'\n'/}" rootcontextblock=${rootcontextblock:0:-1} 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 .context.root &>/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 .context.root "$rootcontextblock" --ccfg-output --output "$serverDir"/server.ccfg fi }