blogker/init/check-ssh.sh

11 lines
277 B
Bash
Raw Permalink Normal View History

2023-08-31 17:00:16 +00:00
#!/bin/bash
SSH_GIT_URL_REGEX="^ssh:\/\/([^@]+@)?([a-z0-9\-\.]+)[:/].*$"
if [[ "$REPO_URL" =~ $SSH_GIT_URL_REGEX ]]; then
echo "Detected SSH repo URL, importing host key"
ssh-keyscan ${BASH_REMATCH[2]} >> /root/.ssh/known_hosts || exit 1
fi
/aux/pull-n-build.sh || exit 1