Update config added -V maxcpus setting

master-b4
Alan Johnston 1 month ago committed by GitHub
parent 19aa8e371b
commit 9ff2826f63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2231,6 +2231,48 @@ elif [ "$1" = "-K" ]; then
restart=1
# fi
elif [ "$1" = "-V" ]; then
echo
echo "Changing the maxcpus setting"
echo
CPUS=$(cat /boot/firmware/cmdline.txt| grep -oP 'maxcpus=\K\d+')
if [ -z "$param2" ] ; then
if [ "$param2" = "1" ] || [ "$param2" = "2" ] || [ "$param2" = "3" ]
sudo sed -i 's/maxcpus=$CPUS/maxcpus=$param2/g'
echo "Setting maxcpus="$param2
else
echo "invalid maxcpus value"
else
echo "Current maxcpus="$CPUs
echo
echo "How many CPUs do you want to set (1-3) ?"
echo "Return keeps current value."
echo "0 removes any maxcpus setting"
read NEWCPU
if [ $NEWCPU = "" ]
echo "No change to maxcpus"
if [ $NEWCPU = "0" ]
sudo sed -i 's/maxcpus=$CPUS//g'
echo "Removing maxcpus setting"
elif [ $NEWCPU = "1" ] || [ $NEWCPU = "2" ] || [ $NEWCPU = "3" ] |
sudo sed -i 's/maxcpus=$CPUS/maxcpus=$NEWCPU/g'
echo "Setting maxcpus="$NEWCPU
else
echo "Invalid maxcpus setting. No change made."
fi
fi
elif [ "$1" = "-h" ]; then
echo "config OPTION"
@ -2278,6 +2320,7 @@ elif [ "$1" = "-h" ]; then
echo " -u Change gpsd state"
echo " -k Reset the PacSatSim Configuration"
echo " -K Change the Doppler frequency shift setting"
echo " -V Set the maximum CPUs"
echo
exit

Loading…
Cancel
Save

Powered by TurnKey Linux.