-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·51 lines (38 loc) · 891 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
47
48
49
50
51
#!/bin/bash
set -e
set -o pipefail
bin_name="dnscovery"
resolvers_file="resolvers.yaml"
signatures_file="signatures.yaml"
build_dir=".build/binaries/"
destination="/usr/local/bin/"
get_os_arch() {
# Get the OS name
os_name=$(uname -s | tr '[:upper:]' '[:lower:]')
# Get the architecture
arch_name=$(uname -m)
# Convert architecture name to the desired format
case "$arch_name" in
x86_64)
arch_name="amd64";;
aarch64)
arch_name="arm64";;
armv7l)
arch_name="arm";;
i686)
arch_name="386";;
*)
arch_name="windows";;
esac
echo "${os_name}-${arch_name}"
}
result=$(get_os_arch)
cp $resolvers_file $destination
cp $signatures_file $destination
cd $build_dir
file=$(ls | grep "$result")
echo "Detected arch: $file"
cp $file $bin_name
echo "Moving to $destination"
mv $bin_name $destination
echo "Installed successfully!"