Skip to content

Commit

Permalink
fix for #3373 and #3384 (#3385)
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon authored Apr 16, 2020
1 parent 8ca6a52 commit 8f58057
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/enable-ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ if [[ -z "${APPVEYOR_SSH_KEY}" ]]; then
exit 1
fi

# make sure OpenSSH is actually installed before enabling
if ! command -v sshd &>/dev/null; then
if command -v apt-get &>/dev/null; then
sudo apt-get update
sudo apt-get install -y openssh-server
elif command -v yum &>/dev/null; then
sudo yum install -y openssh-server
elif command -v apk &>/dev/null; then
sudo apk update
sudo apk add openssh-server
fi
fi

if ! ssh-keygen -E md5 -lf /dev/stdin <<< "${APPVEYOR_SSH_KEY}" >/dev/null; then
echo "APPVEYOR_SSH_KEY contain invalid key!"
exit 2
Expand Down Expand Up @@ -63,7 +76,7 @@ if [ -d /etc/update-motd.d ]; then
echo "'"
) | sudo tee /etc/update-motd.d/01-appveyor >/dev/null
sudo chmod +x /etc/update-motd.d/01-appveyor
fi
fi
if [ "$PLATFORM" = "Darwin" ]; then
(
echo "Project: ${APPVEYOR_PROJECT_NAME}"
Expand Down

0 comments on commit 8f58057

Please sign in to comment.