dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/onomondo-eim/+/42998?usp=email )

Change subject: contrib/onomondo-eim.sh: add option to set a mnesia dir
......................................................................

contrib/onomondo-eim.sh: add option to set a mnesia dir

The onomondo-eim.sh startscript we provide in the contrib directory
does not set the "mnesia dir" parameter when starting the erlang VM.
Let's add a commandline parameter and a default location to the
script.

Related: SYS#8100
Change-Id: I6a13a631da7903db4766168380ce727127a4d47b
---
M contrib/onomondo-eim.sh
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  jolly: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/contrib/onomondo-eim.sh b/contrib/onomondo-eim.sh
index 3252610..0d2a1c4 100755
--- a/contrib/onomondo-eim.sh
+++ b/contrib/onomondo-eim.sh
@@ -29,17 +29,21 @@
   echo "  -s    Enable interactive shell"
   echo "  -r    Application's root directory (default: ${ROOTDIR})"
   echo "  -c    Config file path (default: ${CONFIG})"
+  echo "  -m    Mnesia directory (default: ${MNESIA_DIR})"
   echo "  -C    Erlang node cookie (default: ${COOKIE})"
   echo "  -n    Erlang node name (default: ${NODE_NAME})"
   echo "  -l    Logger level (default: ${LOG_LEVEL})"
 }

 # Parse command line options, if any
-while getopts "c:C:hn:r:sl:" opt; do
+while getopts "c:m:C:hn:r:sl:" opt; do
   case "$opt" in
     c)
       CONFIG="$OPTARG"
       ;;
+    m)
+      MNESIA_DIR="$OPTARG"
+      ;;
     C)
       COOKIE="$OPTARG"
       ;;
@@ -88,6 +92,11 @@
   REL_DIR="${ROOTDIR}/releases/${REL_VSN}"
 fi

+# Determine the mnesia directory path (if not set)
+if [ -z "${MNESIA_DIR}" ]; then
+  MNESIA_DIR="${ROOTDIR}/db"
+fi
+
 # Determine the boot script name
 [ -f "${REL_DIR}/${APP_NAME}.boot" ] && BOOTFILE="${APP_NAME}" || 
BOOTFILE=start

@@ -102,6 +111,7 @@
   -sname "${NODE_NAME}" \
   -mode embedded \
   -kernel logger_level "${LOG_LEVEL}" \
+  -mnesia dir "'${MNESIA_DIR}'" \
   ${ERL_SHELL}

 # vim:set ts=2 sw=2 et:

--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/42998?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I6a13a631da7903db4766168380ce727127a4d47b
Gerrit-Change-Number: 42998
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: jolly <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>

Reply via email to