]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Make use of the new RSYNC_PORT env var.
authorWayne Davison <wayned@samba.org>
Tue, 7 Apr 2020 20:29:29 +0000 (13:29 -0700)
committerWayne Davison <wayned@samba.org>
Tue, 7 Apr 2020 20:36:01 +0000 (13:36 -0700)
stunnel-rsync.in

index fdd8bfd11a9667b16d0ea7857003958198138f4b..ca702ae9e4b4aa1e30d37c1dbe5b2910e66889a7 100755 (executable)
@@ -16,14 +16,19 @@ if [ x"$RSYNC_SSL_CERT" = x ]; then
 else
     cert="cert = $RSYNC_SSL_CERT"
 fi
-if [ x"$RSYNC_SSL_CA_CERT" ]; then
+
+if [ x"$RSYNC_SSL_CA_CERT" = x ]; then
     cafile=""
     verify=0
 else
     cafile="CAfile = $RSYNC_SSL_CA_CERT"
     verify=3
 fi
-port=${RSYNC_SSL_PORT:-874}
+
+port="${RSYNC_PORT:-0}"
+if [ "$port" = 0 ]; then
+    port="${RSYNC_SSL_PORT:-874}"
+fi
 
 # If the user specified USER@HOSTNAME::module, then rsync passes us
 # the -l USER option too, so we must be prepared to ignore it.