winlink-sync.sh
· 1.2 KiB · Bash
Raw
#!/bin/sh
# Sync the downloads from downloads.winlink.org to a local folder
# (and copy the most recent downloads into my own archive)
#
# Author: Dominic Reich (OE7DRT) <quick.hat4396@qtztsjosmprqmgtunjyf.com>
# Lastmod: 2024-10-06
# we need wget for this, check if its installed or abort
command -v wget > /dev/null 2>&1 || { echo >&2 "wget not found"; exit 1; }
ARCHIVE="/srv/http/pub/hamradio/Winlink"
print_usage () {
echo >&2 "usage: $(basename $0)"
echo >&2 " run without arguments, paths are fixed in the code"
echo >&2 " (change them if you like/need to)"
exit 1
}
if [[ $USER == "root" ]]
then
echo >&2 "Must not be root to run! Aborting..."
exit 1
fi
if [ $# -ne 0 ]
then
print_usage
fi
# echo "debug: go into directory $ARCHIVE"
cd ${ARCHIVE}
# echo "debug: get/sync folders"
wget --exclude-directories="**/SCS USB Driver 2.08.24 WHQL Certified" \
--quiet --mirror --accept zip,exe \
https://downloads.winlink.org/
# echo "debug: copy vara files"
cp -u downloads.winlink.org/VARA\ Products/*zip archive/
# echo "debug: copy winlink files"
cp -u downloads.winlink.org/User\ Programs/{Winlink_Express*,Standard_Forms}.zip archive/
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/ |
45 |