-
Notifications
You must be signed in to change notification settings - Fork 10
/
get-fdb.sh
executable file
·51 lines (47 loc) · 1.37 KB
/
get-fdb.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
48
49
50
51
#!/usr/bin/env bash
set -euo pipefail
ARCH=$(arch)
if [ "${ARCH}" != "x86_64" ]; then
echo "Unsupported architecture: ${ARCH}"
exit 0
fi
FDB_VERSION=${1:-7.3.43}
BASE_URL="https://github.com/apple/foundationdb/releases/download/${FDB_VERSION}"
. /etc/os-release
if [[ "${ID_LIKE:-}" =~ rhel|fedora ]]; then
DIST='el'
case ${ID} in
amzn)
VERSION_ID="7"
;;
*)
VERSION_ID="${VERSION_ID%%.*}"
;;
esac
SYSTEM="${DIST}${VERSION_ID}"
case ${SYSTEM} in
el7)
wget "${BASE_URL}/foundationdb-clients-${FDB_VERSION}-1.${SYSTEM}.${ARCH}.rpm" -O ./foundationdb-clients.rpm
rpm -i ./foundationdb-clients.rpm
rm ./foundationdb-clients.rpm
;;
*)
echo "Unsupported system: ${SYSTEM}"
exit 0
;;
esac
elif [[ "${ID:-}" =~ debian|ubuntu ]]; then
ARCH=$(dpkg --print-architecture)
SYSTEM="${ID}${VERSION_ID}"
case ${SYSTEM} in
debian11 | debian12 | ubuntu20.04 | ubuntu22.04 | ubuntu24.04)
wget "${BASE_URL}/foundationdb-clients_${FDB_VERSION}-1_${ARCH}.deb" -O foundationdb-clients.deb
dpkg -i foundationdb-clients.deb
rm foundationdb-clients.deb
;;
*)
echo "Unsupported system: ${SYSTEM}"
exit 0
;;
esac
fi