From a6736af1cc1cce217fe0c753cddd21032d914de1 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sun, 30 Jun 2024 15:44:01 -0400 Subject: [PATCH] Update command to check for USB sound card, exit if C&C off --- command | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/command b/command index b995446d..80c81525 100755 --- a/command +++ b/command @@ -5,28 +5,36 @@ echo -e "\nCommand and Control script for CubeSatSim v1.3.2\n" FILE=/home/pi/CubeSatSim/command_control if [ -f "$FILE" ]; then echo "Radio command and control is ON" - echo "Turning Command and control to OFF" - sudo rm /home/pi/CubeSatSim/command_control - echo "rebooting" - sudo systemctl stop rpitx - sudo reboot now +# echo "Turning Command and control to OFF" +# sudo rm /home/pi/CubeSatSim/command_control +# echo "rebooting" +# sudo systemctl stop rpitx +# sudo reboot now # fi else echo "Radio command and control is OFF" + exit 1 fi -echo "Starting direwolf" -if [ "$1" = "d" ]; then +# if [[ $(grep 'dtparam=audio=on' /boot/config.txt) ]]; then + if [[ $(arecord -l | grep card) ]]; then -echo "debug mode" - -direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/aprs_in.py d + echo "Starting direwolf" + if [ "$1" = "d" ]; then + + echo "debug mode" + + direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/aprs_in.py d + + else + + direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/aprs_in.py + + fi else - -direwolf -c /home/pi/CubeSatSim/direwolf-cc.conf -t 0l | python3 /home/pi/CubeSatSim/aprs_in.py + echo "Starting squelch C&C" fi -