From 3f99f1740980c1097632c9f9b7d6c5d2335f9d65 Mon Sep 17 00:00:00 2001 From: mukowman Date: Thu, 19 Feb 2026 18:22:22 +1100 Subject: [PATCH] Create entrypoint.sh for application startup Add entrypoint script to configure and run the application. --- entrypoint.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..a6481e4 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -eu + +ARGS="" + +# Required args (-s and -d) +ARGS="$ARGS -s ${SERVER_ADDR}" +ARGS="$ARGS -d ${DEVICE_ADDR}" + +# Optional forwarding listener (-f) and sqlite (-sql) +if [ "${ENABLE_FORWARD}" = "true" ]; then + ARGS="$ARGS -f ${FORWARD_ADDR}" +fi + +if [ "${SQLITE}" = "true" ]; then + # Put DB in mounted volume; your script uses sqlite_file = 'meshcore_multitcp.db' + # so we run from /data to keep it persistent. + cd /data + ARGS="$ARGS -sql" +else + cd /app +fi + +# Logging controls (-q or -v). Default is info (no flag). +if [ "${LOG_LEVEL}" = "quiet" ]; then + ARGS="$ARGS -q" +elif [ "${LOG_LEVEL}" = "debug" ]; then + ARGS="$ARGS -v" +fi + +exec python3 /app/meshcore_multitcp.py $ARGS