Fix install_openmnano script order 17/1717/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 27 Apr 2017 15:22:54 +0000 (17:22 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 27 Apr 2017 16:02:09 +0000 (17:02 +0100)
Change-Id: I77782a37436f162b0f94707fb5629c0c7fcbfdbc
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
database_utils/install-db-server.sh

index 5f1c563..d473478 100755 (executable)
@@ -218,6 +218,12 @@ fi
 # if not assuming ubuntu type
 [ -f /etc/redhat-release ] || _DISTRO=$(lsb_release -is  2>/dev/null)
 
+if [[ -z "$NO_PACKAGES" ]]
+then
+    [ "$USER" != "root" ] && echo "Needed root privileges" >&2 && exit 1
+    _install_mysql_package || exit 1
+fi
+
 # Creating temporary file for MYSQL installation and initialization"
 TEMPFILE="$(mktemp -q --tmpdir "installdb.XXXXXX")"
 trap 'rm -f "$TEMPFILE"' EXIT
@@ -249,12 +255,6 @@ then
     exit
 fi
 
-if [[ -z "$NO_PACKAGES" ]]
-then
-    [ "$USER" != "root" ] && echo "Needed root privileges" >&2 && exit 1
-    _install_mysql_package || exit 1
-fi
-
 # Create or update database
 if db_exists $DB_NAME $TEMPFILE ; then
     if [[ -n $FORCEDB ]] ; then