dexter has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/98/42998/1
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: