|
|
@ -1,7 +1,24 @@ |
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
# change branch if set as parameter |
|
|
|
wantedBranch=$1 |
|
|
|
activeBranch=$(git branch | grep \* | cut -d ' ' -f2) |
|
|
|
if [ ${#wantedBranch} -gt 0 ]; then |
|
|
|
echo "your wanted branch is: ${wantedBranch}" |
|
|
|
echo "your active branch is: ${activeBranch}" |
|
|
|
if [ "${wantedBranch}" = "${activeBranch}" ]; then |
|
|
|
echo "OK" |
|
|
|
else |
|
|
|
echo "try changing branch .." |
|
|
|
git checkout ${wantedBranch} |
|
|
|
activeBranch=$(git branch | grep \* | cut -d ' ' -f2) |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
echo "" |
|
|
|
echo "*** UPDATING SHELL SCRIPTS FROM GITHUB ***" |
|
|
|
echo "justincase, not the final upadte mechanism" |
|
|
|
echo "BRANCH --> ${activeBranch}" |
|
|
|
echo "******************************************" |
|
|
|
cd /home/admin/raspiblitz |
|
|
|
git pull |
|
|
|