| | |
| | | # 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. |
| | |
| | | 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. |
| | |
| | | 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 |