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

View File

@ -25,8 +25,13 @@ case "$1" in
db_get openwebrx/admin_user_password db_get openwebrx/admin_user_password
if [ ! -z "${RET}" ]; then if [ ! -z "${RET}" ]; then
# create initial openwebrx user if ! openwebrx-admin --silent hasuser admin; then
OWRX_PASSWORD="${RET}" openwebrx admin --noninteractive adduser admin # 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 fi
# remove password from debconf database # remove password from debconf database
db_unregister openwebrx/admin_user_password db_unregister openwebrx/admin_user_password