X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Frdiff.in;h=60386fac09987446c74d065c8de2cb5fec3053d4;hb=a06826142678cbaf1129c680449c138f6775b82e;hp=98a53a3235c489ee392076429191e06a6c8353fc;hpb=4e0519e390137b18b545f0ad256d03941cdd7bac;p=matthijs%2Fupstream%2Fbackupninja.git 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 }