From 96383b77870bd5b51397cd1b54bea7011364f382 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sun, 11 Apr 2021 19:15:16 +0200 Subject: [PATCH] [fix] Crash if we are not able to retrieve ssh_user --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index e898cf3..902b165 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,6 +57,7 @@ fi # Fix broken value ssh_user that mistakenly got replaced by the public key in previous versions... 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 :( !" ynh_app_setting_set --app=$app --key=ssh_user --value="$ssh_user" fi