From 7962da9454045aeabf5b604513b8c526bd36a49f Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 26 Apr 2021 20:10:44 +0200 Subject: [PATCH] initialize settings --- debian/openwebrx.postinst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/openwebrx.postinst b/debian/openwebrx.postinst index 5bdfceca..aa57b6ec 100755 --- a/debian/openwebrx.postinst +++ b/debian/openwebrx.postinst @@ -6,6 +6,7 @@ set -euo pipefail OWRX_USER="openwebrx" OWRX_DATADIR="/var/lib/openwebrx" OWRX_USERS_FILE="${OWRX_DATADIR}/users.json" +OWRX_SETTINGS_FILE="${OWRX_DATADIR}/settings.json" case "$1" in configure|reconfigure) @@ -23,6 +24,12 @@ case "$1" in chmod 0600 "${OWRX_USERS_FILE}" fi + if [ ! -e "${OWRX_SETTINGS_FILE}" ]; then + # create an empty settings file now to avoid permission problems later + echo "{}" > "${OWRX_SETTINGS_FILE}" + chown "${OWRX_USER}". "${OWRX_SETTINGS_FILE}" + fi + db_get openwebrx/admin_user_password if [ ! -z "${RET}" ]; then if ! openwebrx admin --silent hasuser admin; then