Update config -U param

master-bo
Alan Johnston 2 months ago committed by GitHub
parent e92b7f4567
commit 98c69e6553
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1869,58 +1869,70 @@ elif [ "$1" = "-N" ]; then
elif [ "$1" = "-U" ]; then elif [ "$1" = "-U" ]; then
echo echo
echo "Changing the Random Simulated Failure setting in" echo "Changing the Random Simulated Failure setting"
echo "the configuration file for CubeSatSim"
echo echo
value=`cat /home/pi/CubeSatSim/sim.cfg` value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null echo "$value" > /dev/null
set -- $value set -- $value
if [ "${12}" = "yes" ] || [ "${12}" = "y" ]; then if [ -z "$param2" ] ; then
echo "Random Simulated Failure is ON"
else
echo "Random Simulated Failure is OFF"
fi
echo
# $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${12} ${13} ${14}
echo "Do you want Random Simulated Failure ON (y/n) " if [ "${12}" = "yes" ] || [ "${12}" = "y" ]; then
read sim echo "Random Simulated Failure is ON"
echo else
echo "Random Simulated Failure is OFF"
if [ "$sim" = "y" ] || [ "$sim" = "yes" ] ; then fi
sim="yes"
echo "Random Simulated Failure is ON" echo
echo
echo "A new random failure is selected every" # $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${12} ${13} ${14}
echo ${13} "seconds."
echo
echo "Enter a new value or Return keeps current value."
echo "Enter time in seconds (integer): "
read time echo "Do you want Random Simulated Failure ON (y/n) "
read sim
echo
if [ "$sim" = "y" ] || [ "$sim" = "yes" ] ; then
sim="yes"
echo "Random Simulated Failure is ON"
echo
echo "A new random failure is selected every"
echo ${13} "seconds."
echo
echo "Enter a new value or Return keeps current value."
echo "Enter time in seconds (integer): "
read time
if [ -z $time ] ; then if [ -z $time ] ; then
time="${13}" time="${13}"
echo "Keeping value of " $time " seconds" echo "Keeping value of " $time " seconds"
fi fi
if ! [[ $time =~ ^[0-9]+$ ]] ; then
echo "Error: not an integer!"
time="${13}"
echo "Keeping value of" $time
fi
if ! [[ $time =~ ^[0-9]+$ ]] ; then else
echo "Error: not an integer!" sim="no"
echo "Random Simulated Failure is OFF"
time="${13}" time="${13}"
echo "Keeping value of" $time # echo "-1" > /home/pi/CubeSatSim/failure_mode.txt # make sure to turn off any simulated failures
fi fi
else else
sim="no" time="$param2"
echo "Random Simulated Failure is OFF" echo "Set Random Simulated Failure Time to" $time
time="${13}"
# echo "-1" > /home/pi/CubeSatSim/failure_mode.txt # make sure to turn off any simulated failures if ! [[ $time =~ ^[0-9]+$ ]] ; then
fi echo "Error: not an integer!"
time="${13}"
echo "Keeping value of" $time
fi
fi
# echo # echo
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n" echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"

Loading…
Cancel
Save

Powered by TurnKey Linux.