summaryrefslogtreecommitdiff
path: root/contrib/ssh-copy-id
diff options
context:
space:
mode:
authorPhilip Hands <phil@hands.com>2020-10-03 23:15:16 +0200
committerDarren Tucker <dtucker@dtucker.net>2020-10-13 12:45:05 +1100
commitfd360174596047b52aa1cddda74d85012a03ca4b (patch)
tree091d087802c0ec8139360249fa0b1cce7609a0b5 /contrib/ssh-copy-id
parentf7c3a39b016dd77709ecbf18da8282f967b86cd7 (diff)
downloadopenssh-git-fd360174596047b52aa1cddda74d85012a03ca4b.tar.gz
combine if/elif to avoid duplication of the action
SSH-Copy-ID-Upstream: 42aeb1cc53d3f7f6e78edc210fb121fda0834914
Diffstat (limited to 'contrib/ssh-copy-id')
-rw-r--r--contrib/ssh-copy-id9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
index 6cea9935..1870aed5 100644
--- a/contrib/ssh-copy-id
+++ b/contrib/ssh-copy-id
@@ -201,10 +201,11 @@ populate_new_ids() {
-o LogLevel=INFO \
-o PreferredAuthentications=publickey \
-o IdentitiesOnly=yes "$@" exit >"$L_OUTPUT_FILE" 2>&1 </dev/null
- if [ "$?" = "$L_SUCCESS" ] ; then
- : > "$L_TMP_ID_FILE"
- elif [ "$SFTP" ] && grep 'allows sftp connections only' "$L_OUTPUT_FILE" >/dev/null ; then
- # this error counts as a success when we're setting up an sftp connection
+ if [ "$?" = "$L_SUCCESS" ] || {
+ [ "$SFTP" ] && grep 'allows sftp connections only' "$L_OUTPUT_FILE" >/dev/null
+ # this error counts as a success if we're setting up an sftp connection
+ }
+ then
: > "$L_TMP_ID_FILE"
else
grep 'Permission denied' "$L_OUTPUT_FILE" >/dev/null || {