From f6b0e37664b499755bb7827dec4fab610fffd26f Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Wed, 21 Apr 2021 14:29:36 +0200 Subject: [PATCH] add the ability to set admin user and pass via env variables for docker --- docker/scripts/run.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/scripts/run.sh b/docker/scripts/run.sh index 5f2bf7c..627a12e 100755 --- a/docker/scripts/run.sh +++ b/docker/scripts/run.sh @@ -16,6 +16,11 @@ fi if [[ ! -f /etc/openwebrx/openwebrx.conf ]] ; then cp openwebrx.conf /etc/openwebrx/ fi +if [[ ! -z "${OPENWEBRX_ADMIN_USER:-}" ]] && [[ ! -z "${OPENWEBRX_ADMIN_PASSWORD:-}" ]] ; then + if ! python3 openwebrx-admin.py --silent hasuser "${OPENWEBRX_ADMIN_USER}" ; then + OWRX_PASSWORD="${OPENWEBRX_ADMIN_PASSWORD}" python3 openwebrx-admin.py --noninteractive adduser "${OPENWEBRX_ADMIN_USER}" + fi +fi _term() {