Skip to content

Commit 2a004b2

Browse files
committed
Merge remote-tracking branch 'walkeran/batchmode'
2 parents 377dab5 + a1ca969 commit 2a004b2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

bin/ghe-host-check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ port=$(ssh_port_part "$host")
2424
hostname=$(ssh_host_part "$host")
2525

2626
set +e
27-
output=$(echo "cat \"$GHE_REMOTE_METADATA_FILE\" 2>/dev/null || exit 101" | ghe-ssh $options $host -- /bin/sh 2>&1)
27+
output=$(echo "cat \"$GHE_REMOTE_METADATA_FILE\" 2>/dev/null || exit 101" | ghe-ssh -o 'BatchMode no' $options $host -- /bin/sh 2>&1)
2828
rc=$?
2929
set -e
3030

share/github-backup-utils/ghe-ssh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ set -e
1010
cd $(dirname "$0")/../..
1111
. share/github-backup-utils/ghe-backup-config
1212

13-
opts=$GHE_EXTRA_SSH_OPTS
13+
eval opts=($GHE_EXTRA_SSH_OPTS)
1414
while true; do
1515
case "$1" in
1616
-p|-l|-o)
17-
opts="$opts $1 $2"
17+
opts=("${opts[@]}" $1 "$2")
1818
shift 2
1919
;;
2020
--)
@@ -42,12 +42,12 @@ port=$(ssh_port_part "$host")
4242
host=$(ssh_host_part "$host")
4343

4444
# Add port / -p option when non-standard port given.
45-
[ "$port" != "22" ] && opts="-p $port $opts"
45+
[ "$port" != "22" ] && opts=(-p $port "${opts[@]}")
4646

4747
# Add user / -l option
4848
user="${host%@*}"
4949
[ "$user" = "$host" ] && user="admin"
50-
opts="-l $user $opts"
50+
opts=(-l "$user" "${opts[@]}")
5151

5252
# Bail out with error if the simple command form is used with complex commands.
5353
# Complex
@@ -61,4 +61,4 @@ fi
6161
$GHE_VERBOSE_SSH && set -x
6262

6363
# Exec ssh command with modified host / port args and add nice to command.
64-
exec ssh $opts "$host" -- $GHE_NICE $GHE_IONICE "$@"
64+
exec ssh "${opts[@]}" -o 'BatchMode yes' "$host" -- $GHE_NICE $GHE_IONICE "$@"

0 commit comments

Comments
 (0)