1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgserver_ynh.git synced 2024-09-03 20:36:20 +02:00

Actually fix broken $ssh_user value during upgrade..

This commit is contained in:
Alexandre Aubin 2021-04-11 18:44:28 +02:00 committed by GitHub
parent 593514a128
commit 712660cd62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 ynh_secure_remove /etc/yunohost/hooks.d/backup/17-data_home
fi fi
# Fix broken value ssh_user that mistakenly got replaced by the public key in previous versions...
if echo "$ssh_user" | grep -q ' '; then 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 fi
if echo "$public_key" | grep -q -v ' '; then if echo "$public_key" | grep -q -v ' '; then