git.iko.soy/xmrig-bash-scripts
on master help sign in
51 lines 1.0 kB history raw
1#!/bin/bash
3echo "${_GREEN}BUILD STARTED${_RESET}"
5# Clone source
6if [ -d "$_XMRIG_CLONE_LOCATION" ]; then
7
8 # Change to clone directory
9 cd $_XMRIG_CLONE
11 if git branch | grep -q -m1 "* $_XMRIG_BRANCH"; then
12 # Pull changes from source
13 git pull
15 # Call function
16 build_xmrig
18 else
19 # Switch to required branch
20 git checkout $_XMRIG_BRANCH
22 # Pull changes from source
23 git pull
25 # Call function
26 build_xmrig
27 fi
28else
29 # Clone the source
30 git clone $_XMRIG_REPO $_XMRIG_CLONE
32 # Change to clone directory
33 cd $_XMRIG_CLONE
35 # Fetch list of branches in origin
36 git branch -a
38 # Checkout required branch
39 git checkout $_XMRIG_BRANCH
41 # Call function
42 build_xmrig
43fi
45# Copy binary to directory in env path
46sudo cp $_XMRIG_BUILD_LOCATION/xmrig $_XMRIG_TARGET_LOCATION
48cd $_WORK_DIR
50echo "${_CYAN}BUILD STOPPED${_RESET}"