common bash logger script used for scripts.services.storage
-#!/bin/sh
-if [ "${FLEDGE_ROOT}" = "" ]; then
- if [ ! -x /usr/local/fledge/services/fledge.services.storage ] && [ ! -x /usr/local/fledge/services/storage ]; then
+#!/bin/bash
+# Run a Fledge Storage service written in C/C++
+if [[ "${FLEDGE_ROOT}" = "" ]]; then
+ if [[ ! -x /usr/local/fledge/services/fledge.services.storage ]] && [[ ! -x /usr/local/fledge/services/storage ]]; then
logger "Unable to find Fledge storage microservice in the default location"
exit 1
else
- if [ -x /usr/local/fledge/services/fledge.services.storage ]; then
+ if [[ -x /usr/local/fledge/services/fledge.services.storage ]]; then
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/fledge/lib
/usr/local/fledge/services/fledge.services.storage "$@"
else
@@ -14,17 +15,19 @@ if [ "${FLEDGE_ROOT}" = "" ]; then
exit 0
fi
else
- if [ ! -x ${FLEDGE_ROOT}/services/fledge.services.storage ] && [ ! -x ${FLEDGE_ROOT}/services/storage ]; then
- logger "Unable to find Fledge storage microservice in ${FLEDGE_ROOT}/services/storage"
+ # Include common logger script code
+ . $FLEDGE_ROOT/scripts/common/write_log.sh
+ if [[ ! -x ${FLEDGE_ROOT}/services/fledge.services.storage ]] && [[ ! -x ${FLEDGE_ROOT}/services/storage ]]; then
+ write_log "" "scripts.services.storage" "err" "Unable to find Fledge storage microservice in ${FLEDGE_ROOT}/services/storage" "logonly" ""
exit 1
else
- if [ -x ${FLEDGE_ROOT}/services/fledge.services.storage ]; then
+ if [[ -x ${FLEDGE_ROOT}/services/fledge.services.storage ]]; then
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${FLEDGE_ROOT}/lib:/usr/local/fledge/lib
${FLEDGE_ROOT}/services/fledge.services.storage "$@"
else
${FLEDGE_ROOT}/services/storage "$@"
fi
- logger "Fledge storage microservice found in FLEDGE_ROOT location: ${FLEDGE_ROOT}"
+ write_log "" "scripts.services.storage" "info" "Fledge storage microservice found in FLEDGE_ROOT location: ${FLEDGE_ROOT}" "logonly" ""
exit 0
fi
fi
