diff --git a/scripts/upgrade b/scripts/upgrade index 54c5b50..bfb4482 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,8 +54,10 @@ if [ -f "/etc/yunohost/hooks.d/backup/17-data_home" ]; then ynh_secure_remove /etc/yunohost/hooks.d/backup/17-data_home fi +# Fix broken value ssh_user that mistakenly got replaced by the public key in previous versions... if echo "$ssh_user" | grep -q ' '; then - ynh_app_setting_set --app=$app --key=ssh_user --value="$(grep "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIadutuK2" /home/*/.ssh/authorized_keys | grep borg | cut -d/ -f3)" + ssh_user=$(grep "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIadutuK2" /home/*/.ssh/authorized_keys | grep borg | cut -d/ -f3) + ynh_app_setting_set --app=$app --key=ssh_user --value="$ssh_user" fi if echo "$public_key" | grep -q -v ' '; then