diff --git a/src/freedombone-app-radicale b/src/freedombone-app-radicale index 79595fda..24790c0e 100755 --- a/src/freedombone-app-radicale +++ b/src/freedombone-app-radicale @@ -51,8 +51,8 @@ radicale_variables=(ONION_ONLY function remove_user_radicale { remove_username="$1" - if grep "$remove_username:" ${RADICALE_USERS}; then - sed -i "/$remove_username:/d" ${RADICALE_USERS} + if grep "${remove_username}:" ${RADICALE_USERS}; then + sed -i "/${remove_username}:/d" ${RADICALE_USERS} if [ -d /var/www/radicale/collections/${remove_username} ]; then rm -rf /var/www/radicale/collections/${remove_username} fi @@ -87,15 +87,22 @@ function add_user_radicale { echo '0' } +function change_password_radicale { + existing_username="$1" + new_user_password="$2" + + if grep "${existing_username}:" ${RADICALE_USERS}; then + sed -i "/${existing_username}:/d" ${RADICALE_USERS} + htpasswd -bd ${RADICALE_USERS} "$existing_username" "$new_user_password" + systemctl reload radicale + fi +} + function install_interactive_radicale { echo -n '' APP_INSTALLED=1 } -function change_password_radicale { - echo -n '' -} - function reconfigure_radicale { echo -n '' }