mirror of
https://github.com/do6uk/meshcore_multitcp.git
synced 2026-04-21 03:53:36 +00:00
Create entrypoint.sh for application startup
Add entrypoint script to configure and run the application.
This commit is contained in:
parent
973f0030e4
commit
3f99f17409
1 changed files with 31 additions and 0 deletions
31
entrypoint.sh
Normal file
31
entrypoint.sh
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue