raspiblitz/home.admin/XXupdateScripts.sh

41 lines
1.2 KiB
Bash
Raw Normal View History

2018-08-08 19:58:15 +02:00
#!/bin/bash
2018-12-07 23:51:30 +01:00
2018-12-07 23:58:20 +01:00
cd /home/admin/raspiblitz
2018-12-07 23:51:30 +01:00
# change branch if set as parameter
2018-12-08 00:09:26 +01:00
wantedBranch="$1"
2018-12-07 23:51:30 +01:00
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
2018-12-08 00:09:26 +01:00
else
2018-12-08 00:09:54 +01:00
echo ""
2018-12-08 00:15:36 +01:00
echo "USAGE-INFO: ./XXupdateScripts.sh '[BRANCHNAME]'"
2018-12-07 23:51:30 +01:00
fi
2018-08-08 19:58:15 +02:00
echo ""
echo "*** UPDATING SHELL SCRIPTS FROM GITHUB ***"
echo "justincase, not the final upadte mechanism"
2018-12-07 23:54:51 +01:00
echo "BRANCH --> ${activeBranch} <---"
2018-08-08 19:58:15 +02:00
echo "******************************************"
git pull
cd ..
rm *.sh
rm -r assets
2018-09-21 21:33:13 +02:00
sudo -u admin cp /home/admin/raspiblitz/home.admin/*.* /home/admin
2018-08-08 19:58:15 +02:00
sudo -u admin chmod +x *.sh
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/assets /home/admin/
2018-12-02 20:30:34 +01:00
sudo -u admin cp -r /home/admin/raspiblitz/home.admin/config.scripts /home/admin/
2018-12-02 20:55:45 +01:00
sudo -u admin chmod +x /home/admin/config.scripts/*.sh
2018-08-08 20:00:32 +02:00
echo "******************************************"
2018-08-08 19:58:15 +02:00
echo "OK - shell scripts and assests are up to date"
2018-08-08 19:59:42 +02:00
echo "Reboot recommended"
echo ""