-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·46 lines (36 loc) · 990 Bytes
/
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
#!/bin/bash
platform=$(uname -s)
arch=$(uname -m)
from_dir=$PWD
temp_dir="$HOME/.hostbeat_temp"
install_dir="/usr/local/bin"
base_url="https://github.com/ruben69695/hostbeat-cli/releases/download"
version="2.0.0"
file="x86_64-unknown-linux-musl"
extension=".zip"
echo "Hostbeat $version installer"
if [ ! -d $temp_dir ]; then
mkdir $temp_dir
fi
cd $temp_dir
echo " > ⬇️ Downloading packages..."
if [ $platform == "Darwin" ]; then
if [ $arch == "a64" ]; then
file="aarch64-apple-darwin"
else
file="x86_64-apple-darwin"
fi
fi
resource_url="$base_url/$version/$file$extension"
#echo $resource_url
curl -OL --silent $resource_url
unzip -qq $file$extension
echo " > ⏳ Installing..."
mv "$file/release/hostbeat" "$install_dir/"
chmod "u+x" "$install_dir/hostbeat"
chmod "o+x" "$install_dir/hostbeat"
echo " > 🧹 Cleaning the house..."
cd $from_dir
rm -R $temp_dir
echo " > 🍺 Installed!"
echo " > ⚠️ Reopen your terminal before use the hostbeat CLI"