From 8ee2559efd80ab966eef9cfcef0aeb98b9885fc2 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 20 Nov 2015 16:54:45 +0000
Subject: [PATCH] OPENDJ-2431, OPENDJ-2442, OPENDJ-2448: Fix various license checking / approval with split install - instance. Now the license is read if present from the install (read-only) and the approval is written in the instance (and the directory created if needed). Note that upgrade will require to re-approve the license.

---
 opendj-server-legacy/resource/upgrade |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/resource/upgrade b/opendj-server-legacy/resource/upgrade
index 3b582e7..98a52e5 100644
--- a/opendj-server-legacy/resource/upgrade
+++ b/opendj-server-legacy/resource/upgrade
@@ -22,7 +22,7 @@
 # CDDL HEADER END
 #
 #
-#      Copyright 2013-2014 ForgeRock AS
+#      Copyright 2013-2015 ForgeRock AS
 
 
 # This script may be used to perform a backup of a Directory Server backend.
@@ -33,11 +33,25 @@
 export SCRIPT_NAME
 
 SCRIPT_DIR=`dirname "${0}"`
-DIR_CLASSES="${SCRIPT_DIR}/classes"
+
+INSTALL_ROOT=${SCRIPT_DIR}
+export INSTALL_ROOT
+
+# Set environment variables
+SCRIPT_UTIL_CMD=set-environment-vars
+export SCRIPT_UTIL_CMD
+.  "${INSTALL_ROOT}/lib/_script-util.sh"
+RETURN_CODE=$?
+if test ${RETURN_CODE} -ne 0
+then
+  exit ${RETURN_CODE}
+fi
+
+DIR_CLASSES="${INSTANCE_ROOT}/classes"
 # The upgrade is not compatible with patches. If the folder is not empty
 # we renamed it as "classes.disabled", and the upgrade process should be launched properly.
 if [ "`(ls -A ${DIR_CLASSES})`" ]; then
-    mv -f ${DIR_CLASSES} "${SCRIPT_DIR}/classes.disabled"
+    mv -f ${DIR_CLASSES} "${INSTANCE_ROOT}/classes.disabled"
     mkdir ${DIR_CLASSES}
 fi
 

--
Gitblit v1.10.0