git.iko.soy/xmrig-bash-scripts
on master help sign in
wip
5120cd0Sean Wheller
build.sh+14−11
@@ -11,21 +11,24 @@ if [ -d "$_XMRIG_CLONE_LOCATION" ]; then
11 # Change to clone directory
11 # Change to clone directory
12 cd $_XMRIG_CLONE
12 cd $_XMRIG_CLONE
13
13
14− if [ git branch | grep -m1 "* $_XMRIG_BRANCH" ]; then
14+ if git branch | grep -q -m1 "* $_XMRIG_BRANCH"; then
15− # Pull changes from source
15+ # Pull changes from source
16− git pull
16+ git pull
17
17
18− # Call function
18+ # Call function
19− build_xmrig
19+ build_xmrig
20− else
21− # Checkout required branch
22− git checkout $_XMRIG_BRANCH
23
20
24− # Call function
21+ else
25− build_xmrig
22+ # Switch to required branch
23+ echo "Require: $_XMRIG_BRANCH Switching !!!"
24+ git checkout $_XMRIG_BRANCH
26
25
27− fi
26+ # Pull changes from source
27+ git pull
28
28
29+ # Call function
30+ build_xmrig
31+ fi
29else
32else
30 # Clone the source
33 # Clone the source
31 echo "Cloning source to $_WORK_DIR/$_XMRIG_CLONE"
34 echo "Cloning source to $_WORK_DIR/$_XMRIG_CLONE"