change password if user already exists

This commit is contained in:
Jakob Ketterl 2021-04-24 20:12:39 +02:00
parent 6de91c0c4e
commit 2da2a57e13
1 changed files with 7 additions and 2 deletions

View File

@ -25,8 +25,13 @@ case "$1" in
db_get openwebrx/admin_user_password
if [ ! -z "${RET}" ]; then
# create initial openwebrx user
OWRX_PASSWORD="${RET}" openwebrx admin --noninteractive adduser admin
if ! openwebrx-admin --silent hasuser admin; then
# create initial openwebrx user
OWRX_PASSWORD="${RET}" openwebrx admin --noninteractive adduser admin
else
# change existing user's password
OWRX_PASSWORD="${RET}" openwebrx admin --noninteractive resetpassword admin
fi
fi
# remove password from debconf database
db_unregister openwebrx/admin_user_password