Update update option to checkout new branch

fc-fctelem
Alan Johnston 11 months ago committed by GitHub
parent b1428951f4
commit 04acaf9bbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,9 +1,20 @@
#!/bin/bash
echo -e "\nupdate script for CubeSatSim v2.0\n"
echo -e "\nupdate script for CubeSatSim v2.1\n"
FLAG=0
checkout=0
if [ -z "$1" ] ; then
checkout=0
else
checkout=1
branch="$1"
echo $branch
FLAG=1
fi
if [ "$1" = "n" ] ; then
# if [ -z "$2" ] ; then
noreboot=1
else
noreboot=0
@ -39,6 +50,10 @@ cd /home/pi/CubeSatSim
git pull --no-rebase > .updated
if [ $checkout -eq 1 ]; then
git checkout $branch
fi
make debug
FILE=/home/pi/CubeSatSim/command_tx
@ -57,8 +72,6 @@ else
echo "0\n" > /home/pi/CubeSatSim/command_count.txt
fi
FLAG=0
if [[ $(diff systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service) ]]; then
echo "changed cubesatsim.service."
sudo cp /home/pi/CubeSatSim/systemd/cubesatsim.service /etc/systemd/system/cubesatsim.service
@ -358,7 +371,7 @@ if [ "$noreboot" = "0" ] ; then
fi
else
if [ $FLAG -eq 1 ]; then
echo "reboot needed for changes to take effect"
echo "reboot needed for changes to take effect" | wall
fi
fi

Loading…
Cancel
Save

Powered by TurnKey Linux.