-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
46 lines (40 loc) · 1.29 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
#!/usr/bin/env bash
set -e
if [ -z "${DEBUG}" ]; then
set +o xtrace
else
set -o xtrace
fi
VERSION="0.3.0"
if [ "$(uname)" == "Darwin" ]; then
INSTALL_URI="/usr/local/bin/ilagent"
FILE_URL="https://github.com/iLert/ilagent/releases/download/${VERSION}/ilagent_mac"
rm $INSTALL_URI || true
echo "[MacOS] Downloading binary.. please be patient."
curl -sL $FILE_URL --output $INSTALL_URI
chmod 777 $INSTALL_URI
echo "Done"
ilagent --help
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
if [ "$(expr substr $(uname -m) 1 3)" == "arm" ]; then
INSTALL_URI="/usr/bin/ilagent"
FILE_URL="https://github.com/iLert/ilagent/releases/download/${VERSION}/ilagent_arm"
sudo rm $INSTALL_URI || true
echo "[ARM] Downloading binary.. please be patient."
sudo curl -sL $FILE_URL --output $INSTALL_URI
sudo chmod 777 $INSTALL_URI
echo "Done"
ilagent --help
else
INSTALL_URI="/usr/bin/ilagent"
FILE_URL="https://github.com/iLert/ilagent/releases/download/${VERSION}/ilagent_linux"
sudo rm $INSTALL_URI || true
echo "[Linux] Downloading binary.. please be patient."
sudo curl -sL $FILE_URL --output $INSTALL_URI
sudo chmod 777 $INSTALL_URI
echo "Done"
ilagent --help
fi
else
echo "Unsupported platform, please install manually."
fi