Update config -N check for fail mode

sim-fail-4
Alan Johnston 4 months ago committed by GitHub
parent 6ff74af6d4
commit 282589ddaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1624,42 +1624,60 @@ elif [ "$1" = "-M" ]; then
elif [ "$1" = "-N" ]; then elif [ "$1" = "-N" ]; then
echo "Next mode" FILE=/home/pi/CubeSatSim/failure_mode.txt
if [ -f "$FILE" ]; then
value=`cat /home/pi/CubeSatSim/.mode` if [[ $(grep "\-1" $FILE) ]]; then
echo "$value" > /dev/null echo "No simulated failure"
set -- $value fail=0
else
echo "Simulated failure mode"
fail=$(<$FILE)
echo $fail
else
echo "No simulated failure"
fail=0
fi
if [ "$1" = "a" ]; then if [ $fail == 0 ] then
echo "Current mode is APRS" echo "Changing to next mode"
echo "Next mode is FSK"
/home/pi/CubeSatSim/config -f value=`cat /home/pi/CubeSatSim/.mode`
elif [ "$1" = "m" ]; then echo "$value" > /dev/null
echo "Current mode is CW" set -- $value
echo "Next mode is FunCube"
/home/pi/CubeSatSim/config -j if [ "$1" = "a" ]; then
elif [ "$1" = "f" ]; then echo "Current mode is APRS"
echo "Current mode is FSK" echo "Next mode is FSK"
echo "Next mode is BPSK" /home/pi/CubeSatSim/config -f
/home/pi/CubeSatSim/config -b elif [ "$1" = "m" ]; then
elif [ "$1" = "b" ]; then echo "Current mode is CW"
echo "Current mode is BPSK" echo "Next mode is FunCube"
echo "Next mode is SSTV" /home/pi/CubeSatSim/config -j
/home/pi/CubeSatSim/config -s elif [ "$1" = "f" ]; then
elif [ "$1" = "s" ]; then echo "Current mode is FSK"
echo "Current mode is SSTV" echo "Next mode is BPSK"
echo "Next mode is CW" /home/pi/CubeSatSim/config -b
/home/pi/CubeSatSim/config -m elif [ "$1" = "b" ]; then
elif [ "$1" = "e" ]; then echo "Current mode is BPSK"
echo "Current mode is Repeater" echo "Next mode is SSTV"
echo "Next mode is APRS" /home/pi/CubeSatSim/config -s
/home/pi/CubeSatSim/config -a elif [ "$1" = "s" ]; then
elif [ "$1" = "j" ]; then echo "Current mode is SSTV"
echo "Current mode is FUNcube" echo "Next mode is CW"
echo "Next mode is Repeater" /home/pi/CubeSatSim/config -m
/home/pi/CubeSatSim/config -e elif [ "$1" = "e" ]; then
else echo "Current mode is Repeater"
echo "Unknown mode" echo "Next mode is APRS"
/home/pi/CubeSatSim/config -a
elif [ "$1" = "j" ]; then
echo "Current mode is FUNcube"
echo "Next mode is Repeater"
/home/pi/CubeSatSim/config -e
else
echo "Unknown mode"
fi
else
echo "Changing to next simulated failure mode"
fi fi
elif [ "$1" = "-h" ]; then elif [ "$1" = "-h" ]; then

Loading…
Cancel
Save

Powered by TurnKey Linux.