-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
60 lines (48 loc) · 1.13 KB
/
install.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
52
53
54
55
56
57
58
59
60
set -eu
log_error() {
echo "[ERROR] $1" >&2
}
if [ -z "${AQUA_VERSION:-}" ]; then
log_error "AQUA_VERSION is required"
exit 1
fi
has_command() {
local cmd=$1
command -v $cmd > /dev/null 2>&1
}
if ! has_command bash; then
if has_command apt-get; then
apt-get update -y
apt-get install -y bash
elif has_command apk > /dev/null 2>&1; then
apk add bash
else
log_error "bash isn't found. Please install bash to run aqua-installer"
exit 1
fi
fi
if ! has_command curl && ! has_command wget; then
if has_command apt-get; then
apt-get update -y
apt-get install -y curl
elif has_command apk > /dev/null 2>&1; then
apk add curl
else
log_error "Neither curl nor wget is found. Please install either curl or wget to download aqua"
exit 1
fi
fi
pwd
ls
url=https://raw.githubusercontent.com/aquaproj/aqua-installer/v3.0.0/aqua-installer
tempdir=$(mktemp -d)
cd "$tempdir"
if has_command curl; then
curl -sSfL -O "$url"
elif has_command wget; then
wget "$url"
fi
echo "8299de6c19a8ff6b2cc6ac69669cf9e12a96cece385658310aea4f4646a5496d aqua-installer" | sha256sum -c
chmod +x aqua-installer
./aqua-installer
rm -R "$tempdir"