1
0
mirror of https://github.com/craigerl/aprsd.git synced 2026-01-14 09:35:37 -05:00
aprsd/docker/bin/run.sh
Walter Boring 8ab6717b17 Add the run.sh switches to show the loglevel
This adds the command line args for aprsd server to
show the thread, loglevel and location in the logs for
the container build of aprsd
2025-12-13 10:19:44 -05:00

46 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -x
source /app/.venv/bin/activate
if [ ! -z "${APRSD_PLUGINS}" ]; then
OLDIFS=$IFS
IFS=','
echo "Installing pypi plugins '$APRSD_PLUGINS'";
for plugin in ${APRSD_PLUGINS}; do
IFS=$OLDIFS
# call your procedure/other scripts here below
echo "Installing '$plugin'"
uv pip install --user $plugin
done
fi
if [ ! -z "${APRSD_EXTENSIONS}" ]; then
OLDIFS=$IFS
IFS=','
echo "Installing APRSD extensions from pypi '$APRSD_EXTENSIONS'";
for extension in ${APRSD_EXTENSIONS}; do
IFS=$OLDIFS
# call your procedure/other scripts here below
echo "Installing '$extension'"
uv pip install --user $extension
done
fi
if [ -z "${LOG_LEVEL}" ] || [[ ! "${LOG_LEVEL}" =~ ^(CRITICAL|ERROR|WARNING|INFO)$ ]]; then
LOG_LEVEL="DEBUG"
fi
echo "Log level is set to ${LOG_LEVEL}";
# check to see if there is a config file
APRSD_CONFIG="/config/aprsd.conf"
if [ ! -e "$APRSD_CONFIG" ]; then
echo "'$APRSD_CONFIG' File does not exist. Creating."
uv run aprsd sample-config > $APRSD_CONFIG
fi
export COLUMNS=200
python3 -m rich.diagnose
exec aprsd server -c $APRSD_CONFIG --loglevel ${LOG_LEVEL} --show-thread --show-level --show-location