#!/bin/sh
# *******************************************************
# THIS FILE WAS AUTO-GENERATED BY ATLASSIAN BITBUCKET.
# IT CONTAINS NO USER-SERVICEABLE PARTS.
# *******************************************************
#
# Wrapper script to run SCM operations over SSH using a custom SSH private key.
#

export SSH_COMMON_FLAGS="-C -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o UserKnownHostsFile=/dev/null \
 -o SendEnv=BB_IS_MIRROR"

if [ "${BITBUCKET_SSH_KEY}x" = "x" ]; then
    exec "$BITBUCKET_SSH_EXEC" $SSH_COMMON_FLAGS $@
else
    exec "$BITBUCKET_SSH_EXEC" -i "$BITBUCKET_SSH_KEY" $SSH_COMMON_FLAGS -o "AddKeysToAgent=no" $@
fi