mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
10.41.2015 647458098381de3d9cf67b6f3c8356367858ffc8
opendj-packages/opendj-deb/resources/control/postinst
@@ -24,7 +24,6 @@
#      Copyright 2013-2015 ForgeRock AS.
#
set -e
# Post install script
# Install is launched with an empty second arg.
# If the package is already installed, the second arg. is not empty.
@@ -42,11 +41,6 @@
        echo *Starting upgrade...
        ${deb.prefix}/./upgrade -n --acceptLicense
        echo
        if [ "$?" -eq 2 ] ; then
            # Upgrade fails - Requires mandatory user interaction.
            # Nevertheless, exits successfully of the pkg process.
            exit 0
        fi
        if [ "$?" -eq 0 ] ; then
            # Restarts the service if needed.
@@ -57,13 +51,31 @@
                echo
                echo "*Restarting server..."
                ${deb.prefix}/./bin/start-ds
                rm -f ${deb.prefix}/logs/status
                if [ "$?" -eq 0 ] ; then
                    rm -f ${deb.prefix}/logs/status
                else
                    echo "start-ds failed with return code $?. Please read ${deb.prefix}/logs/status for more details."
                fi
            fi
        else
            # Upgrade fails - Requires mandatory user interaction.
            # Nevertheless, exits successfully of the pkg process.
            echo "upgrade failed with return code $?. Please read the installation guide for more information on the upgrade process."
            exit 0
        fi
    else
        echo "Invalid installation, could not find the build info file."
        exit -1
    fi
fi
# Add OpenDJ man pages to MANPATH
MAN_CONFIG_FILE=/etc/manpath.config
MANPATH_DIRECTIVE=MANDATORY_MANPATH
grep -q "$MANPATH_DIRECTIVE.*opendj" $MAN_CONFIG_FILE 2> /dev/null
if [ $? -ne 0 ]; then
    echo "$MANPATH_DIRECTIVE ${deb.prefix}/share/man" >> $MAN_CONFIG_FILE
fi
# End post install script
echo