From f4bdd75d61dcb9e932265b42f4126dd6e912860c Mon Sep 17 00:00:00 2001 From: Mari Date: Fri, 26 Jun 2020 19:45:48 -0400 Subject: [PATCH] Update new-host.sh --- new-host.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/new-host.sh b/new-host.sh index b352a75..ba3b000 100644 --- a/new-host.sh +++ b/new-host.sh @@ -28,7 +28,8 @@ fi function getCurrentGithubId() { local RESULT; - RESULT=$(ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_ed25519 -T git@github.com &1) || echo "$RESULT" >&2; exit 1 + RESULT=$(ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_ed25519 -T git@github.com &1) + [[ $? -ne 255 ]] || echo "$RESULT" >&2; exit 1 USERNAME=$(echo "$RESULT" | sed -n 's/^Hi \([^!]\+\)! You'"'"'ve successfully authenticated, but GitHub does not provide shell access\.$/Successfully authenticated to GitHub as \1/; T; p') || exit 1 echo "$USERNAME" [[ -n "$USERNAME" ]];