@@ -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
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
18− # Call function
18+ # Call function
19− build_xmrig
19+ build_xmrig
21− # Checkout required branch
22− git checkout $_XMRIG_BRANCH
24− # Call function
21+ else
25− build_xmrig
22+ # Switch to required branch
23+ echo "Require: $_XMRIG_BRANCH Switching !!!"
24+ git checkout $_XMRIG_BRANCH
27− fi
26+ # Pull changes from source
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"