Skip to content

Commit

Permalink
20200714 Correct Remote Configs Install in Update File
Browse files Browse the repository at this point in the history
  • Loading branch information
davecrump committed Jul 15, 2020
1 parent e696a83 commit a3fe8fb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
1 change: 0 additions & 1 deletion check_for_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ then
cd /home/pi
rm update.sh >/dev/null 2>/dev/null
wget https://raw.githubusercontent.com/BritishAmateurTelevisionClub/ryde-build/master/update.sh
# wget https://raw.githubusercontent.com/davecrump/ryde-build/master/update.sh
chmod +x update.sh
source /home/pi/update.sh
exit
Expand Down
42 changes: 23 additions & 19 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
# Created by davecrump 20200714 for Ryde on Buster Raspios

echo
echo "------------------------------------------"
echo "----- Updating Ryde Receiver Software-----"
echo "------------------------------------------"
echo "----------------------------------------"
echo "----- Updating Ryde Receiver System-----"
echo "----------------------------------------"
echo

# Stop the receiver to allow the update
sudo killall python3 >/dev/null 2>/dev/null
sleep 0.3
if pgrep -x "python3" >/dev/null
then
sudo killall -9 python3 >/dev/null 2>/dev/null
fi

## Check which update to load
GIT_SRC_FILE=".ryde_gitsrc"
if [ -e ${GIT_SRC_FILE} ]; then
Expand All @@ -34,7 +42,6 @@ else
echo "Updating to latest ${GIT_SRC} development Portsdown build";
fi


cd /home/pi

PATHUBACKUP="/home/pi/user_backups"
Expand All @@ -45,17 +52,16 @@ cp -f -r /home/pi/ryde-build/installed_version.txt "$PATHUBACKUP"/prev_installed

# Make a safe copy of the Config files in "$PATHUBACKUP" to restore at the end

cp -f -r /home/pi/ryde/config.yaml "$PATHUBACKUP"/config.yaml

cp -f -r /home/pi/ryde/handset.yaml "$PATHUBACKUP"/handset.yaml
cp -f -r /home/pi/ryde/config.yaml "$PATHUBACKUP"/config.yaml >/dev/null 2>/dev/null
cp -f -r /home/pi/ryde/handset.yaml "$PATHUBACKUP"/handset.yaml >/dev/null 2>/dev/null

# And capture the RC protocol in the rx.sh file:
cp -f -r /home/pi/ryde-build/rx.sh "$PATHUBACKUP"/rx.sh

echo
echo "------------------------------------------"
echo "----- Updating the Software Packages -----"
echo "------------------------------------------"
echo "-------------------------------------------------"
echo "----- Updating the System Software Packages -----"
echo "-------------------------------------------------"
echo

sudo dpkg --configure -a # Make sure that all the packages are properly configured
Expand All @@ -77,8 +83,8 @@ echo "----- Updating Ryde Build Utilities-----"
echo "----------------------------------------"
echo
rm -rf /home/pi/ryde-build
wget https://github.com/davecrump/ryde-build/archive/master.zip
# wget https://github.com/${GIT_SRC}/ryde-build/archive/master.zip
# wget https://github.com/davecrump/ryde-build/archive/master.zip
wget https://github.com/${GIT_SRC}/ryde-build/archive/master.zip
unzip -o master.zip
mv ryde-build-master ryde-build
rm master.zip
Expand Down Expand Up @@ -118,9 +124,9 @@ cd /home/pi

# Download the previously selected version of Ryde
echo
echo "-------------------------"
echo "----- Updating Ryde -----"
echo "-------------------------"
echo "--------------------------------"
echo "----- Updating Ryde Player -----"
echo "--------------------------------"
echo
rm -rf /home/pi/ryde
# wget https://github.com/davecrump/rydeplayer/archive/master.zip
Expand All @@ -132,6 +138,8 @@ cd /home/pi/ryde

cp /home/pi/pydispmanx/pydispmanx.cpython-37m-arm-linux-gnueabihf.so pydispmanx.cpython-37m-arm-linux-gnueabihf.so

cd /home/pi

# Download and overwrite the latest remote control definitions and images
echo
echo "----------------------------------------------"
Expand All @@ -145,10 +153,6 @@ rm -rf /home/pi/RydeHandsets/images
git clone -b definitions https://github.com/${GIT_SRC}/RydeHandsets.git RydeHandsets/definitions
git clone -b images https://github.com/${GIT_SRC}/RydeHandsets.git RydeHandsets/images

cd /home/pi

# Restore the user's original config files here

# Restore the user's config, or use new if handset.yaml does not exist

if [[ -f "$PATHUBACKUP"/handset.yaml ]]; then
Expand Down

0 comments on commit a3fe8fb

Please sign in to comment.