From 1c766e38bc93b1184bfa20a072f55b308b2da310 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sun, 6 Jun 2021 07:38:36 -0400 Subject: [PATCH] added test for update script update --- update | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/update b/update index 1e7a0d58..70ebfcea 100755 --- a/update +++ b/update @@ -34,6 +34,24 @@ else echo "no changes to rpitx.service" fi +FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 1" + cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg +fi + +FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +if [ ! -f "$FILE" ]; then + echo "Copying SSTV image 2" + cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg +fi + +grep 'update' /home/pi/CubeSatSim/.updated +if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then + echo "update script updated" + /home/pi/CubeSatSim/update +fi + if [ $FLAG -eq 1 ]; then echo "systemctl daemon-reload and restart" sudo systemctl daemon-reload @@ -47,16 +65,3 @@ else echo "nothing to do" fi fi - -FILE=/home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 1" - cp /home/pi/CubeSatSim/sstv/sstv_image_1_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_1_320_x_256.jpg -fi - -FILE=/home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -if [ ! -f "$FILE" ]; then - echo "Copying SSTV image 2" - cp /home/pi/CubeSatSim/sstv/sstv_image_2_320_x_256.jpg /home/pi/CubeSatSim/sstv_image_2_320_x_256.jpg -fi -