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

Merge pull request #33 from YunoHost-Apps/testing

Also check during upgrade that ssh user ain't empty to avoid catastrophies
This commit is contained in:
Alexandre Aubin 2021-04-11 19:26:46 +02:00 committed by GitHub
commit 73c89d07ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,6 +55,7 @@ if [ -f "/etc/yunohost/hooks.d/backup/17-data_home" ]; then
fi
# Fix broken value ssh_user that mistakenly got replaced by the public key in previous versions...
[ -n "$ssh_user" ] || ynh_die "Unable to retrieve ssh_user please fix /etc/yunohost/apps/$app/settings.yml manually :( !"
if echo "$ssh_user" | grep -q ' '; then
ssh_user=$(grep "$ssh_user" /home/*/.ssh/authorized_keys | grep borg | cut -d/ -f3)
[ -n "$ssh_user" ] || ynh_die "Unable to retrieve ssh_user please fix /etc/yunohost/apps/$app/settings.yml manually :( !"