trying to get cd speed

This commit is contained in:
inxi-svn 2014-09-20 03:22:55 +00:00
parent 023903796c
commit 7ac76db61c

9
inxi
View file

@ -7452,12 +7452,19 @@ get_optical_drive_data_bsd()
sub(/serial[[:space:]]+number[[:space:]]*/,"",$NF) sub(/serial[[:space:]]+number[[:space:]]*/,"",$NF)
aDisks[nr, "serial"] = $NF aDisks[nr, "serial"] = $NF
} }
if ( $NF ~ /[GM]B\/s/ ){
speed=gensub(/^[0-9\.]+[[:space:]]*[GM]B\/s).*/,"\\1",1,$NF)
sub(/\.[0-9]+/,"",speed)
if ( speed ~ /^[0-9]+/ ) {
aDisks[nr, "speed"] = speed
}
}
} }
# "$link,dev-readlinks,$vendor,$model,$rev_number,$proc_info_string,$state" # "$link,dev-readlinks,$vendor,$model,$rev_number,$proc_info_string,$state"
# $proc_info_string: print speed "," multisession "," mcn "," audio "," cdr "," cdrw "," dvd "," dvdr "," dvdram # $proc_info_string: print speed "," multisession "," mcn "," audio "," cdr "," cdrw "," dvd "," dvdr "," dvdram
END { END {
for (i=1;i<=nr;i++) { for (i=1;i<=nr;i++) {
print aDisks[i, "id"] ",,," aDisks[i, "model"] "," aDisks[i, "rev"] ",,,,,,,,," print aDisks[i, "id"] ",,," aDisks[i, "model"] "," aDisks[i, "rev"] "," aDisks[i, "speed"] ",,,,,,,,"
} }
}' <<< "$Dmesg_Boot_Data" ) ) }' <<< "$Dmesg_Boot_Data" ) )
IFS="$ORIGINAL_IFS" IFS="$ORIGINAL_IFS"