[1/2] hddshutdown: Update script for new iostat output format - Bug#12702

Message ID 20211008213824.2754445-1-adolf.belka@ipfire.org
State Accepted
Commit 74b9fcc65e73802926ce6c1cc3d488598b361802
Headers
Series [1/2] hddshutdown: Update script for new iostat output format - Bug#12702 |

Commit Message

Adolf Belka Oct. 8, 2021, 9:38 p.m. UTC
  - Modification of iostat line as per input in Bug#12702

Fixes: 12702
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 src/scripts/hddshutdown | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/src/scripts/hddshutdown b/src/scripts/hddshutdown
index 146cc7347..ce345e374 100644
--- a/src/scripts/hddshutdown
+++ b/src/scripts/hddshutdown
@@ -36,7 +36,7 @@  foreach (@devices){
     my @array = split(/\//,$_);
     $diskstats = `cat /var/run/hddstats-$array[$#array] 2>/dev/null`;
     chomp $diskstats;
-    $newdiskstats = `iostat -d -t $_ | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
+    $newdiskstats = `iostat -d -t $_ | tail -3 | head -1 | awk '{ print \$6","\$7}'`;
     chomp $newdiskstats;
     $status = `hdparm -C /dev/$_ | tail -1 | cut -d: -f2`;
     chomp $status;