summaryrefslogtreecommitdiff
path: root/etc/common
diff options
context:
space:
mode:
Diffstat (limited to 'etc/common')
-rw-r--r--etc/common9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/common b/etc/common
index 0501240..de3cfac 100644
--- a/etc/common
+++ b/etc/common
@@ -232,3 +232,12 @@ savelog() {
done
mv "${torotate}" "${torotate}.0"
}
+
+# Return rsync version
+rsync_protocol() {
+ RSYNC_VERSION="$(${RSYNC} --version)"
+ if [[ $RSYNC_VERSION =~ (protocol[ ]+version[ ]+([0-9]+)) ]]; then
+ echo ${BASH_REMATCH[2]}
+ fi
+ unset RSYNC_VERSION
+}