From 46eccf2fd0c894790405b2e3aae8dfb99f5a5d98 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 9 Jan 2010 23:25:03 +0100 Subject: rdiff: fix confusing error if rdiff-backup cannot be found on remote server. Thanks to maniacmartin for the patch on which this one is based. This closes Redmine bug #1209. --- handlers/rdiff.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'handlers/rdiff.in') diff --git a/handlers/rdiff.in b/handlers/rdiff.in index 98a53a3..60386fa 100644 --- a/handlers/rdiff.in +++ b/handlers/rdiff.in @@ -31,6 +31,7 @@ function get_version() { # given no arguments, returns the local version. # given a user and host, returns the remote version. # if user or host is missing, returns the local version. + local version if [ "$#" -lt 2 ]; then debug "$RDIFFBACKUP -V" echo `$RDIFFBACKUP -V` @@ -38,7 +39,12 @@ function get_version() { local user=$1 local host=$2 debug "ssh $sshoptions $host -l $user '$RDIFFBACKUP -V'" - echo `ssh $sshoptions $host -l $user "$RDIFFBACKUP -V | grep rdiff-backup"` + version=`ssh $sshoptions $host -l $user "$RDIFFBACKUP -V"` + if [ $? = 127 ]; then + fatal "Unable to execute rdiff-backup on remote server. It probably isn't installed" + else + echo "$version" | grep rdiff-backup + fi fi } -- cgit v1.2.3