From 9af60f21a97a47394c0bb26d96f308d9c3ec73a1 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Mon, 27 May 2013 15:23:06 +0000
Subject: [PATCH] OPENDJ-941 Package Upgrade: pre-install script should call stop-ds if the instance is not configured

---
 opends/resource/debian/control/prerm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/opends/resource/debian/control/prerm b/opends/resource/debian/control/prerm
index 7722e7b..b3c16eb 100644
--- a/opends/resource/debian/control/prerm
+++ b/opends/resource/debian/control/prerm
@@ -2,7 +2,8 @@
 set -e
 # Pre rm script
 # Stops the server
-if [ "$1" = "remove" ]
+# Only if the instance has been configured
+if [ "$1" = "remove" ] && ( [ -f @prefix@/config/buildinfo ] && [ "$(ls -A @prefix@/config/archived-configs)" ] )
 then
   echo *Stopping OpenDJ server...
   @prefix@/bin/./stop-ds

--
Gitblit v1.10.0