passepartout-apple/scripts/ci/recognize-match-hostname.sh
Davide De Rosa 20a6ba1dc3 Reorganize scripts into subfolders
/  = Local scripts
  ci = Remote scripts (run by workflow)
util = Utilities
2021-10-05 19:27:02 +02:00

7 lines
193 B
Bash
Executable File

#!/bin/sh
HOSTNAME=`echo $MATCH_GIT_URL | sed -E "s/^.*@(.*):.*$/\1/"`
grep -q $HOSTNAME ~/.ssh/known_hosts
if [[ $? != 0 ]]; then
ssh-keyscan $HOSTNAME 2>/dev/null >>~/.ssh/known_hosts
fi