-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·51 lines (35 loc) · 1010 Bytes
/
build.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
#!/bin/bash
echo "${_GREEN}BUILD STARTED${_RESET}"
# Clone source
if [ -d "$_XMRIG_CLONE_LOCATION" ]; then
# Change to clone directory
cd $_XMRIG_CLONE
if git branch | grep -q -m1 "* $_XMRIG_BRANCH"; then
# Pull changes from source
git pull
# Call function
build_xmrig
else
# Switch to required branch
git checkout $_XMRIG_BRANCH
# Pull changes from source
git pull
# Call function
build_xmrig
fi
else
# Clone the source
git clone $_XMRIG_REPO $_XMRIG_CLONE
# Change to clone directory
cd $_XMRIG_CLONE
# Fetch list of branches in origin
git branch -a
# Checkout required branch
git checkout $_XMRIG_BRANCH
# Call function
build_xmrig
fi
# Copy binary to directory in env path
sudo cp $_XMRIG_BUILD_LOCATION/xmrig-proxy $_XMRIG_TARGET_LOCATION
cd $_WORK_DIR
echo "${_CYAN}BUILD STOPPED${_RESET}"