Skip to content

Commit 1a95869

Browse files
cjwatsonWayneD
authored andcommitted
Allow basic connectivity check via rrsync
rsbackup (https://github.com/ewxrjk/rsbackup) uses "ssh <host> true" to check that the host in question is reachable. I like to configure my backed-up hosts to force the backup system to go via `rrsync`, but I always have to add a local tweak to allow `SSH_ORIGINAL_COMMAND=true` to work. I think this would be safe enough to include in rrsync.
1 parent c9fe6ca commit 1a95869

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

support/rrsync

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ def main():
156156
command = os.environ.get('SSH_ORIGINAL_COMMAND', None)
157157
if not command:
158158
die("Not invoked via sshd")
159+
if command == 'true':
160+
# Allow checking connectivity with "ssh <host> true". (For example,
161+
# rsbackup uses this.)
162+
sys.exit(0)
159163
command = command.split(' ', 2)
160164
if command[0:1] != ['rsync']:
161165
die("SSH_ORIGINAL_COMMAND does not run rsync")

0 commit comments

Comments
 (0)