From c9b7185499cd67424a1b0da1b8fe4b1b1a02f0d8 Mon Sep 17 00:00:00 2001 From: Matthew Pounsett Date: Fri, 5 May 2023 08:17:38 -0400 Subject: [PATCH] accept optional source address for rsync of data, fixes #8 - adds an optional config parameter `rsync_source`, which will set the bind_interface option on the ssh session used by rsync when present --- .../general/sie-dns-sensor/etc/default/sie-dns-sensor | 1 + packaging/general/sie-dns-sensor/usr/lib/sie/functions | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packaging/general/sie-dns-sensor/etc/default/sie-dns-sensor b/packaging/general/sie-dns-sensor/etc/default/sie-dns-sensor index c1bd657..bd4249e 100644 --- a/packaging/general/sie-dns-sensor/etc/default/sie-dns-sensor +++ b/packaging/general/sie-dns-sensor/etc/default/sie-dns-sensor @@ -7,6 +7,7 @@ maxper="16" channel="ch202" interface="eth0" +# rsync_source="2001:db8::1" # optional DNSQR_RES_ADDRS="192.0.2.1, 2001:db8::1" syslog_priority="local5.info" diff --git a/packaging/general/sie-dns-sensor/usr/lib/sie/functions b/packaging/general/sie-dns-sensor/usr/lib/sie/functions index bd0ba52..abe5d80 100644 --- a/packaging/general/sie-dns-sensor/usr/lib/sie/functions +++ b/packaging/general/sie-dns-sensor/usr/lib/sie/functions @@ -47,7 +47,13 @@ fi ### internal settings -ssh_cmd="ssh -p %p -i $uploadkey -o UserKnownHostsFile=$knownhosts -o StrictHostKeyChecking=yes" +if [ -z "$rsync_source" ]; then + source_cmd="" +else + source_cmd="-b $rsync_source" +fi + +ssh_cmd="ssh $source_cmd -p %p -i $uploadkey -o UserKnownHostsFile=$knownhosts -o StrictHostKeyChecking=yes" rsync_args="--timeout=10 --remove-source-files" submitservice="_rsync._tcp."