-
Notifications
You must be signed in to change notification settings - Fork 2
/
zeek-deb-download.sh
executable file
·47 lines (41 loc) · 1.28 KB
/
zeek-deb-download.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
unset VERBOSE
command -v dpkg >/dev/null 2>&1 && ARCH="$(dpkg --print-architecture)" || ARCH=amd64
DISTRO=Debian_12
OUTPUT_DIR=/tmp
ZEEK_VERSION=7.0.1-0
while getopts a:d:o:vz: opts; do
case ${opts} in
a) ARCH=${OPTARG} ;;
d) DISTRO=${OPTARG} ;;
o) OUTPUT_DIR=${OPTARG} ;;
v) VERBOSE=1 ;;
z) ZEEK_VERSION=${OPTARG} ;;
esac
done
set -e
if [[ -n $VERBOSE ]]; then
set -x
fi
URL_PREFIX="https://downloadcontentcdn.opensuse.org/repositories/security:/zeek/${DISTRO}"
URLS=(
"${URL_PREFIX}/${ARCH}/libbroker-dev_${ZEEK_VERSION}_${ARCH}.deb"
"${URL_PREFIX}/${ARCH}/zeek-core-dev_${ZEEK_VERSION}_${ARCH}.deb"
"${URL_PREFIX}/${ARCH}/zeek-core_${ZEEK_VERSION}_${ARCH}.deb"
"${URL_PREFIX}/${ARCH}/zeek-spicy-dev_${ZEEK_VERSION}_${ARCH}.deb"
"${URL_PREFIX}/${ARCH}/zeek_${ZEEK_VERSION}_${ARCH}.deb"
"${URL_PREFIX}/${ARCH}/zeekctl_${ZEEK_VERSION}_${ARCH}.deb"
"${URL_PREFIX}/all/zeek-client_${ZEEK_VERSION}_all.deb"
"${URL_PREFIX}/all/zeek-zkg_${ZEEK_VERSION}_all.deb"
"${URL_PREFIX}/all/zeek-btest_${ZEEK_VERSION}_all.deb"
"${URL_PREFIX}/all/zeek-btest-data_${ZEEK_VERSION}_all.deb"
)
pushd "$OUTPUT_DIR" >/dev/null 2>&1
for URL in ${URLS[@]}; do
curl -fsSL -O -J "${URL}"
done
popd >/dev/null 2>&1
if [[ -n $VERBOSE ]]; then
set +x
fi
set +e