Update storage-test.sh
This commit is contained in:
@@ -104,25 +104,27 @@ IO4kRandWrite=0
|
||||
# Did the user give a folder ?
|
||||
ChosenPartition=""
|
||||
if [ "$1" = "" ]; then
|
||||
drives="$(/bin/df -kTh | grep ext4)"
|
||||
echo
|
||||
Print_Style "Select a drive to test from:" "$YELLOW"
|
||||
df=0; declare -A drive_sel
|
||||
echo "$(/bin/df -kTh | grep ext4)" | while IFS= read -r line ; do
|
||||
((df++))
|
||||
path=$(echo $line | cut -d'%' -f2)
|
||||
drive_sel[$df]=${path// }
|
||||
df=0
|
||||
echo "$drives" | while IFS= read -r line ; do
|
||||
((df++)); path=$(echo $line | cut -d'%' -f2)
|
||||
Print_Style "$df) ${path// }" "$CYAN"
|
||||
done
|
||||
echo
|
||||
# read -r -p '#: ' drive_path </dev/tty
|
||||
|
||||
echo
|
||||
echo ${drive_sel[@]}
|
||||
echo "cd ${drive_sel[1]}"
|
||||
echo "cd ${drive_sel[2]}"
|
||||
echo "cd ${drive_sel[3]}"
|
||||
df=0
|
||||
echo "$drives" | while IFS= read -r line ; do
|
||||
((df++)); path=$(echo $line | cut -d'%' -f2)
|
||||
if [ $df -eq $drive_path ]; then
|
||||
echo $path
|
||||
break
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
cd \
|
||||
else
|
||||
if [ ! -d "$1" ]; then
|
||||
Print_Style "Your chosen partition (folder) does not exist! Provide a good one or run without parameters to check the rootfs" "$RED"
|
||||
|
||||
Reference in New Issue
Block a user