@@ -11,21 +11,24 @@ if [ -d "$_XMRIG_CLONE_LOCATION" ]; then
1111 # Change to clone directory
1212 cd $_XMRIG_CLONE
1313
14− if [ git branch | grep -m1 "* $_XMRIG_BRANCH" ]; then
15− # Pull changes from source
16− git pull
14+ if git branch | grep -q -m1 "* $_XMRIG_BRANCH"; then
15+ # Pull changes from source
16+ git pull
1717
18− # Call function
19− build_xmrig
20− else
21− # Checkout required branch
22− git checkout $_XMRIG_BRANCH
18+ # Call function
19+ build_xmrig
2320
24− # Call function
25− build_xmrig
21+ else
22+ # Switch to required branch
23+ echo "Require: $_XMRIG_BRANCH Switching !!!"
24+ git checkout $_XMRIG_BRANCH
2625
27− fi
26+ # Pull changes from source
27+ git pull
2828
29+ # Call function
30+ build_xmrig
31+ fi
2932else
3033 # Clone the source
3134 echo "Cloning source to $_WORK_DIR/$_XMRIG_CLONE"