From 7ac76db61c1423ffab23677bfb3ae629c5fbd03d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 20 Sep 2014 03:22:55 +0000 Subject: [PATCH] trying to get cd speed --- inxi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index 09bac50..c5819d5 100755 --- a/inxi +++ b/inxi @@ -7452,12 +7452,19 @@ get_optical_drive_data_bsd() sub(/serial[[:space:]]+number[[:space:]]*/,"",$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" # $proc_info_string: print speed "," multisession "," mcn "," audio "," cdr "," cdrw "," dvd "," dvdr "," dvdram END { 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" ) ) IFS="$ORIGINAL_IFS"