summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorSimon Paillard <spaillard@debian.org>2013-04-29 23:52:14 +0200
committerSimon Paillard <spaillard@debian.org>2013-05-01 01:23:16 +0200
commita37134881c4192415fd13c2981393eed3bf393ad (patch)
tree65e94a6f14926ce23cd37e8c5e6cd27c13726645 /etc
parent9ddbe78f2723ae6766d0f13d6941fb2c3a22609d (diff)
Move reusable code to function rsync_protocol
Diffstat (limited to 'etc')
-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
+}