Bugs fixed in scripts related to database init and migrate
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 20 Sep 2016 09:54:32 +0000 (11:54 +0200)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 20 Sep 2016 09:54:32 +0000 (11:54 +0200)
Change-Id: Ie03ed8ba52a2d10296cef20860aceed35462702b
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
database_utils/init_mano_db.sh
database_utils/migrate_mano_db.sh
scripts/install-openmano.sh

index 4b73441..9fc9b75 100755 (executable)
@@ -91,14 +91,14 @@ done
 shift $((OPTIND-1))
 
 #check and ask for database user password
-#DBUSER_="-u$DBUSER"
-#DBPASS_=""
-#[ -n "$DBPASS" ] && DBPASS_="-p$DBPASS"
+DBUSER_="-u$DBUSER"
+DBPASS_=""
+[ -n "$DBPASS" ] && DBPASS_="-p$DBPASS"
 DBHOST_="-h$DBHOST"
 DBPORT_="-P$DBPORT"
 
 TEMPFILE="$(mktemp -q --tmpdir "initmanodb.XXXXXX")"
-trap 'rm -f "$TEMPFILE"' EXIT
+trap 'rm -f "$TEMPFILE"' EXIT SIGINT SIGTERM
 chmod 0600 "$TEMPFILE"
 cat >"$TEMPFILE" <<EOF
 [client]
@@ -133,7 +133,8 @@ if [ -n "${CREATEDB}" ]; then
 fi
 
 echo "    loading ${DIRNAME}/${DBNAME}_structure.sql"
-mysql $DEF_EXTRA_FILE_PARAM $DBHOST_ $DBPORT $DBNAME < ${DIRNAME}/mano_db_structure.sql
+#echo 'mysql '$DEF_EXTRA_FILE_PARAM' '$DBHOST_' '$DBPORT_' '$DBNAME' < '${DIRNAME}'/mano_db_structure.sql'
+mysql $DEF_EXTRA_FILE_PARAM $DBHOST_ $DBPORT_ $DBNAME < ${DIRNAME}/mano_db_structure.sql
 
 echo "    migrage database version"
 ${DIRNAME}/migrate_mano_db.sh $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ -d$DBNAME
index 8c1d924..4131c9c 100755 (executable)
@@ -111,7 +111,7 @@ OPENMANO_VER_NUM=`printf "%d%03d%03d" ${VERSION_1} ${VERSION_2} ${VERSION_3}`
 
 #Creating temporary file
 TEMPFILE="$(mktemp -q --tmpdir "migratemanodb.XXXXXX")"
-trap 'rm -f "$TEMPFILE"' EXIT
+trap 'rm -f "$TEMPFILE"' EXIT SIGINT SIGTERM
 chmod 0600 "$TEMPFILE"
 cat >"$TEMPFILE" <<EOF
 [client]
index 4a2ff72..3849bd7 100755 (executable)
@@ -257,7 +257,7 @@ echo '
 #################################################################'
 echo -e "\nCreating temporary file form MYSQL installation and initialization"
 TEMPFILE="$(mktemp -q --tmpdir "installopenmano.XXXXXX")"
-trap 'rm -f "$TEMPFILE"' EXIT
+trap 'rm -f "$TEMPFILE"' EXIT SIGINT SIGTERM
 chmod 0600 "$TEMPFILE"
 cat >"$TEMPFILE" <<EOF
 [client]