From 5fcfa8f36979c7247d3f80cf5aa95af2781ca87d Mon Sep 17 00:00:00 2001 From: si458 Date: Mon, 16 Sep 2024 11:00:33 +0100 Subject: [PATCH] fix storage volumes on arch/busybox Signed-off-by: si458 --- agents/modules_meshcore/computer-identifiers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/modules_meshcore/computer-identifiers.js b/agents/modules_meshcore/computer-identifiers.js index 7a27c2c5..778086eb 100644 --- a/agents/modules_meshcore/computer-identifiers.js +++ b/agents/modules_meshcore/computer-identifiers.js @@ -156,7 +156,7 @@ function linux_identifiers() // Fetch storage volumes using df child = require('child_process').execFile('/bin/sh', ['sh']); child.stdout.str = ''; child.stdout.on('data', dataHandler); - child.stdin.write('df --output=size,used,avail,target,fstype | awk \'NR>1 {printf "{\\"size\\":\\"%s\\",\\"used\\":\\"%s\\",\\"available\\":\\"%s\\",\\"mount_point\\":\\"%s\\",\\"type\\":\\"%s\\"},", $1, $2, $3, $4, $5}\' | sed \'$ s/,$//\' | awk \'BEGIN {printf "["} {printf "%s", $0} END {printf "]"}\'\nexit\n'); + child.stdin.write('df -T | awk \'NR==1 || $1 ~ ".+"{print $3, $4, $5, $7, $2}\' | awk \'NR>1 {printf "{\\"size\\":\\"%s\\",\\"used\\":\\"%s\\",\\"available\\":\\"%s\\",\\"mount_point\\":\\"%s\\",\\"type\\":\\"%s\\"},", $1, $2, $3, $4, $5}\' | sed \'$ s/,$//\' | awk \'BEGIN {printf "["} {printf "%s", $0} END {printf "]"}\'\nexit\n'); child.waitExit(); try { ret.volumes = JSON.parse(child.stdout.str.trim()); } catch (xx) { } child = null;