From 1b3c10032036f01e23ec311d3f01bc9a8be5c39c Mon Sep 17 00:00:00 2001 From: jerry048 <61510650+jerry048@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:44:15 +0800 Subject: [PATCH] Update .boot-script.sh --- Miscellaneous/.boot-script.sh | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/Miscellaneous/.boot-script.sh b/Miscellaneous/.boot-script.sh index c58c310..16d3edb 100644 --- a/Miscellaneous/.boot-script.sh +++ b/Miscellaneous/.boot-script.sh @@ -26,25 +26,17 @@ do drive+=($device) i=$(( $i + 1 )) done -i=1 -x=0 -disktype=$(cat /sys/block/sda/queue/rotational) -if [ "${disktype}" == 0 ]; then - while [ $i -le $diskno ] - do - diskname=$(eval echo ${drive["$x"]}) +i=1 x=0 +while [ $i -le $diskno ] +do + diskname=$(eval echo ${drive["$x"]}) + disktype=$(cat /sys/block/$diskname/queue/rotational) + if [ "${disktype}" == 0 ]; then echo kyber > /sys/block/$diskname/queue/scheduler - i=$(( $i + 1 )) - x=$(( $x + 1 )) - done -else - while [ $i -le $diskno ] - do - diskname=$(eval echo ${drive["$x"]}) + else echo mq-deadline > /sys/block/$diskname/queue/scheduler - i=$(( $i + 1 )) - x=$(( $x + 1 )) - done -fi + fi +i=$(( $i + 1 )) x=$(( $x + 1 )) +done clear -exit 0 \ No newline at end of file +exit 0