From 2da2a57e13721ec6afd80249148826533f64cbd8 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 24 Apr 2021 20:12:39 +0200 Subject: [PATCH] change password if user already exists --- debian/openwebrx.postinst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debian/openwebrx.postinst b/debian/openwebrx.postinst index 9f6b18a..efb938c 100755 --- a/debian/openwebrx.postinst +++ b/debian/openwebrx.postinst @@ -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