-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall.sh
executable file
·38 lines (31 loc) · 936 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
# Install Script
# Usage: curl -s $addr | sh
platform='unknown'
host='https://connect.segment.com.s3-us-west-2.amazonaws.com'
binary='connect-kafka'
install_dir='/usr/local/bin'
arch='amd64'
if [[ "$OSTYPE" == "linux-gnu" ]]; then
platform='linux'
elif [[ "$OSTYPE" == "darwin"* ]]; then
platform='darwin'
elif [[ "$OSTYPE" == "cygwin" ]]; then
platform='windows'
elif [[ "$OSTYPE" == "msys" ]]; then
platform='windows'
elif [[ "$OSTYPE" == "win32" ]]; then
echo 'Platform is not supported!'
exit 1
elif [[ "$OSTYPE" == "freebsd"* ]]; then
platform='freebsd'
else
echo 'Platform is not supported!'
exit 1
fi
echo "Installing $binary for $platform/$arch..."
echo "Debug $host/$binary-$platform-$arch"
curl -s "$host/$binary-$platform-$arch" >> "$install_dir/$binary"
chmod +x $install_dir/$binary
size=$(wc -c <"$install_dir/$binary")
echo "Size: $size"
echo "$binary was installed successfully to $install_dir"