Update config set fail rnd time

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

@ -1570,9 +1570,10 @@ elif [ "$1" = "-M" ]; then
echo " 9 Failed BME Sensor"
echo "10 Failed MPU Sensor"
echo "11 Failed FM Audio"
echo "12 Random Failure"
echo
echo "Enter the failure number to set: 0 - 11"
echo "Enter the failure number to set: 0 - 12"
# echo "Enter the failure number to set: 0 - 9"
read MODE
echo
@ -1581,6 +1582,57 @@ elif [ "$1" = "-M" ]; then
if [ "$MODE" = "0" ]; then
echo "Setting No Simulated Failure"
MODE=-1
elseif [ "$MODE" = "12" ]; then
echo "Setting Random Simulated Failure"
echo
echo "with a new random failure selected in seconds"
echo
echo "Return keeps current value."
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
echo
echo -n "Current value in seconds is"
echo ${13}
echo
# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13}
echo -e "Enter time in seconds (integer): "
read time
if [ -z $time ] ; then
time="${13}"
echo "Keeping value of" $time
fi
if ! [[ $time =~ ^[0-9]+$ ]] ; then
echo "Error: not an integer!"
time="${13}"
echo "Keeping value of" $time
norestart=1
else
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
echo $1 $resets $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13}
echo $1 $resets $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg
fi
if [ "$norestart" = "1" ]; then
echo
else
reboot=1
fi
else
case $MODE in
1)

Loading…
Cancel
Save

Powered by TurnKey Linux.