Skip to content

archlinux-syncrepo: update to latest script version #429

@JuniorJPDJ

Description

@JuniorJPDJ
git diff 4fe427a2..master -- roles/syncrepo/files/syncrepo-template.sh                                                                                                                                                  188.211.16.105   14%  ─╯
diff --git a/roles/syncrepo/files/syncrepo-template.sh b/roles/syncrepo/files/syncrepo-template.sh
index ca7a3db7..d6a9d5ca 100755
--- a/roles/syncrepo/files/syncrepo-template.sh
+++ b/roles/syncrepo/files/syncrepo-template.sh
@@ -44,6 +44,9 @@ bwlimit=0
 # https://www.archlinux.org/mirrors/
 source_url=''
 
+# Set to 0 if the mirror does not support TLS.
+tls=1
+
 # An HTTP(S) URL pointing to the 'lastupdate' file on your chosen mirror.
 # If you are a tier 1 mirror use: https://rsync.archlinux.org/lastupdate
 # Otherwise use the HTTP(S) URL from your chosen mirror.
@@ -62,8 +65,14 @@ flock -n 9 || exit
 find "${target}" -name '.~tmp~' -exec rm -r {} +
 
 rsync_cmd() {
-       local -a cmd=(rsync -rlptH --safe-links --delete-delay --delay-updates
-               "--timeout=600" "--contimeout=60" --no-motd)
+       local -a cmd
+       if ((tls>0)); then
+               cmd=(rsync-ssl --type=openssl)
+       else
+               cmd=(rsync)
+       fi
+       cmd+=(-rlptH --safe-links --delete-delay --delay-updates
+               "--timeout=600" --no-motd)
 
        if stty &>/dev/null; then
                cmd+=(-h -v --progress)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions