Skip to content

Commit 4a52289

Browse files
authored
Merge pull request #378 from github/checkmuxssh
Move check for git for ssh muxing into ghe-ssh
2 parents 4b7f71f + 1c874eb commit 4a52289

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bin/ghe-backup

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ echo "$GHE_SNAPSHOT_TIMESTAMP $$" > ../in-progress
117117

118118
echo "Starting backup of $GHE_HOSTNAME in snapshot $GHE_SNAPSHOT_TIMESTAMP"
119119

120-
# Warn if git is not installed, and set GHE_DISABLE_SSH_MUX=true
121-
command -v git >/dev/null 2>&1 || echo "Warning: SSH multiplexing requires git but it's not installed." && export GHE_DISABLE_SSH_MUX=true
122-
123120
# Perform a host connection check and establish the remote appliance version.
124121
# The version is available in the GHE_REMOTE_VERSION variable and also written
125122
# to a version file in the snapshot directory itself.

share/github-backup-utils/ghe-ssh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ if echo "$*" | grep "[|;]" >/dev/null || [ $(echo "$*" | wc -l) -gt 1 ]; then
6262
exit 1
6363
fi
6464

65+
# Warn if git is not installed, and set GHE_DISABLE_SSH_MUX=true
66+
if [ -z "$GHE_DISABLE_SSH_MUX" ]; then
67+
command -v git >/dev/null 2>&1 || echo "Warning: SSH multiplexing requires git but it's not installed." && export GHE_DISABLE_SSH_MUX=true
68+
fi
69+
6570
if [ -z "$GHE_DISABLE_SSH_MUX" ]; then
6671
controlpath="$TMPDIR/.ghe-sshmux-$(echo -n "$user@$host:$port" | git hash-object --stdin | cut -c 1-8)"
6772
opts="-o ControlMaster=auto -o ControlPath=\"$controlpath\" -o ControlPersist=10m -o ServerAliveInterval=10 $opts"

0 commit comments

Comments
 (0)