Update config set $2 to mode

sim-fail-2
Alan Johnston 4 months ago committed by GitHub
parent 708f9359d0
commit 9c9eb24b8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

132
config

@ -1490,78 +1490,78 @@ elif [ "$1" = "-j" ]; then
elif [ "$1" = "-M" ]; then elif [ "$1" = "-M" ]; then
if [ $fail ]; then if [ $fail ]; then
echo "fail has a value!" MODE=$fail
echo $fail else
fi
FILE=/home/pi/CubeSatSim/failure_mode.txt FILE=/home/pi/CubeSatSim/failure_mode.txt
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
if [[ $(grep "\-1" $FILE) ]]; then if [[ $(grep "\-1" $FILE) ]]; then
echo "Currently, no simulated failure" echo "Currently, no simulated failure"
else else
fail=$(<$FILE) fail=$(<$FILE)
echo -n "Currently, simulated " echo -n "Currently, simulated "
case $fail in case $fail in
1) 1)
echo "+X Solar Panel Failure" echo "+X Solar Panel Failure"
;; ;;
2) 2)
echo "-X Solar Panel Degredation" echo "-X Solar Panel Degredation"
;; ;;
3) 3)
echo "-Y Solar Panel Short Circuit" echo "-Y Solar Panel Short Circuit"
;; ;;
4) 4)
echo "Failed I2C Bus 1" echo "Failed I2C Bus 1"
;; ;;
5) 5)
echo "Failed I2C Bus 3" echo "Failed I2C Bus 3"
;; ;;
6) 6)
echo "Failed Camera" echo "Failed Camera"
;; ;;
7) 7)
echo "Failed Payload" echo "Failed Payload"
;; ;;
8) 8)
echo "Failed BME Sensor" echo "Failed BME Sensor"
;; ;;
9) 9)
echo "Failed MPU Sensor" echo "Failed MPU Sensor"
;; ;;
# "10") # "10")
# echo "Failed FM Audio" # echo "Failed FM Audio"
# ;; # ;;
*) *)
echo "Unknown Failure" echo "Unknown Failure"
;; ;;
esac esac
fi
else
echo "Currently, no simulated failure"
fi fi
else
echo "Currently, no simulated failure"
fi
echo echo
echo "Set simulated failure mode (or Return to turn OFF)" echo "Set simulated failure mode (or Return to turn OFF)"
echo echo
echo " 0 No Failure (turn OFF)" echo " 0 No Failure (turn OFF)"
echo " 1 +X Solar Panel Failure" echo " 1 +X Solar Panel Failure"
echo " 2 -X Solar Panel Degredation" echo " 2 -X Solar Panel Degredation"
echo " 3 -Y Solar Panel Short Circuit" echo " 3 -Y Solar Panel Short Circuit"
echo " 4 Failed I2C Bus 1" echo " 4 Failed I2C Bus 1"
echo " 5 Failed I2C Bus 3" echo " 5 Failed I2C Bus 3"
echo " 6 Failed Camera" echo " 6 Failed Camera"
echo " 7 Failed Payload" echo " 7 Failed Payload"
echo " 8 Failed BME Sensor" echo " 8 Failed BME Sensor"
echo " 9 Failed MPU Sensor" echo " 9 Failed MPU Sensor"
# echo "10 Failed FM Audio" # echo "10 Failed FM Audio"
echo echo
# echo "Enter the failure number to set: 0 - 10" # 10 sometimes gets stuck on carrier # echo "Enter the failure number to set: 0 - 10" # 10 sometimes gets stuck on carrier
echo "Enter the failure number to set: 0 - 9" echo "Enter the failure number to set: 0 - 9"
read MODE read MODE
fi
echo echo
if [ "$MODE" = "0" ]; then if [ "$MODE" = "0" ]; then

Loading…
Cancel
Save

Powered by TurnKey Linux.