dominic a révisé ce gist 1 year ago. Aller à la révision
1 file changed, 44 insertions
winlink-sync.sh(fichier créé)
| @@ -0,0 +1,44 @@ | |||
| 1 | + | #!/bin/sh | |
| 2 | + | ||
| 3 | + | # Sync the downloads from downloads.winlink.org to a local folder | |
| 4 | + | # (and copy the most recent downloads into my own archive) | |
| 5 | + | # | |
| 6 | + | # Author: Dominic Reich (OE7DRT) <quick.hat4396@qtztsjosmprqmgtunjyf.com> | |
| 7 | + | # Lastmod: 2024-10-06 | |
| 8 | + | ||
| 9 | + | # we need wget for this, check if its installed or abort | |
| 10 | + | command -v wget > /dev/null 2>&1 || { echo >&2 "wget not found"; exit 1; } | |
| 11 | + | ||
| 12 | + | ARCHIVE="/srv/http/pub/hamradio/Winlink" | |
| 13 | + | ||
| 14 | + | print_usage () { | |
| 15 | + | echo >&2 "usage: $(basename $0)" | |
| 16 | + | echo >&2 " run without arguments, paths are fixed in the code" | |
| 17 | + | echo >&2 " (change them if you like/need to)" | |
| 18 | + | exit 1 | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | if [[ $USER == "root" ]] | |
| 22 | + | then | |
| 23 | + | echo >&2 "Must not be root to run! Aborting..." | |
| 24 | + | exit 1 | |
| 25 | + | fi | |
| 26 | + | ||
| 27 | + | if [ $# -ne 0 ] | |
| 28 | + | then | |
| 29 | + | print_usage | |
| 30 | + | fi | |
| 31 | + | ||
| 32 | + | # echo "debug: go into directory $ARCHIVE" | |
| 33 | + | cd ${ARCHIVE} | |
| 34 | + | ||
| 35 | + | # echo "debug: get/sync folders" | |
| 36 | + | wget --exclude-directories="**/SCS USB Driver 2.08.24 WHQL Certified" \ | |
| 37 | + | --quiet --mirror --accept zip,exe \ | |
| 38 | + | https://downloads.winlink.org/ | |
| 39 | + | ||
| 40 | + | # echo "debug: copy vara files" | |
| 41 | + | cp -u downloads.winlink.org/VARA\ Products/*zip archive/ | |
| 42 | + | ||
| 43 | + | # echo "debug: copy winlink files" | |
| 44 | + | cp -u downloads.winlink.org/User\ Programs/{Winlink_Express*,Standard_Forms}.zip archive/ | |
Plus récent
Plus ancien