1
0
mirror of https://github.com/craigerl/aprsd.git synced 2026-06-12 10:58:54 -04:00
Files
aprsd/docker/bin/run.sh
T

46 lines
1.2 KiB
Bash
Raw Normal View History

2020-12-11 14:23:08 -05:00
#!/usr/bin/env bash
2020-12-15 10:27:53 -05:00
set -x
2020-12-11 14:23:08 -05:00
2025-01-15 18:00:12 -05:00
source /app/.venv/bin/activate
2021-01-12 16:17:11 -05:00
if [ ! -z "${APRSD_PLUGINS}" ]; then
2020-12-15 10:27:53 -05:00
OLDIFS=$IFS
IFS=','
2021-01-12 16:17:11 -05:00
echo "Installing pypi plugins '$APRSD_PLUGINS'";
for plugin in ${APRSD_PLUGINS}; do
2020-12-15 10:27:53 -05:00
IFS=$OLDIFS
# call your procedure/other scripts here below
echo "Installing '$plugin'"
2025-01-15 18:00:12 -05:00
uv pip install --user $plugin
2020-12-15 10:27:53 -05:00
done
fi
2020-12-11 14:23:08 -05:00
2024-02-25 15:05:45 -05:00
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'"
2025-01-15 18:00:12 -05:00
uv pip install --user $extension
2024-02-25 15:05:45 -05:00
done
fi
2021-12-02 17:08:41 -08:00
if [ -z "${LOG_LEVEL}" ] || [[ ! "${LOG_LEVEL}" =~ ^(CRITICAL|ERROR|WARNING|INFO)$ ]]; then
LOG_LEVEL="DEBUG"
fi
echo "Log level is set to ${LOG_LEVEL}";
2020-12-11 14:23:08 -05:00
# check to see if there is a config file
2022-12-30 10:13:25 -05:00
APRSD_CONFIG="/config/aprsd.conf"
2020-12-11 14:23:08 -05:00
if [ ! -e "$APRSD_CONFIG" ]; then
echo "'$APRSD_CONFIG' File does not exist. Creating."
2025-01-15 18:00:12 -05:00
uv run aprsd sample-config > $APRSD_CONFIG
2020-12-11 14:23:08 -05:00
fi
2021-02-16 10:05:11 -05:00
2022-01-08 09:41:17 -05:00
export COLUMNS=200
python3 -m rich.diagnose
exec aprsd server -c $APRSD_CONFIG --loglevel ${LOG_LEVEL} --show-thread --show-level --show-location