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,7 +1624,22 @@ elif [ "$1" = "-M" ]; then
elif [ "$1" = "-N" ]; then
echo "Next mode"
FILE=/home/pi/CubeSatSim/failure_mode.txt
if [ -f "$FILE" ]; then
if [[ $(grep "\-1" $FILE) ]]; then
echo "No simulated failure"
fail=0
else
echo "Simulated failure mode"
fail=$(<$FILE)
echo $fail
else
echo "No simulated failure"
fail=0
fi
if [ $fail == 0 ] then
echo "Changing to next mode"
value=`cat /home/pi/CubeSatSim/.mode`
echo "$value" > /dev/null
@ -1661,6 +1676,9 @@ elif [ "$1" = "-N" ]; then
else
echo "Unknown mode"
fi
else
echo "Changing to next simulated failure mode"
fi
elif [ "$1" = "-h" ]; then

Loading…
Cancel
Save

Powered by TurnKey Linux.