1
0
Fork 0

Update new-host.sh

main
Mari 5 years ago committed by GitHub
parent f4bdd75d61
commit ae557a03bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      new-host.sh

@ -29,7 +29,7 @@ fi
function getCurrentGithubId() {
local RESULT;
RESULT=$(ssh -o "IdentitiesOnly=yes" -i ~/.ssh/id_ed25519 -T git@github.com </dev/null 2>&1)
[[ $? -ne 255 ]] || echo "$RESULT" >&2; exit 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" ]];

Loading…
Cancel
Save