fix storage volumes on arch/busybox
Signed-off-by: si458 <simonsmith5521@gmail.com>
si458 committed
Sep 16, 2024 at 11:00 UTC
5fcfa8f36979c7247d3f80cf5aa95af2781ca87d
1 file changed
+1
-1
agents/modules_meshcore/computer-identifiers.js
+1
-1
@@ -156,7 +156,7 @@ function linux_identifiers()
156
// Fetch storage volumes using df
157
child = require('child_process').execFile('/bin/sh', ['sh']);
158
child.stdout.str = ''; child.stdout.on('data', dataHandler);
159
- 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');
159
+ 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');
160
child.waitExit();
161
try { ret.volumes = JSON.parse(child.stdout.str.trim()); } catch (xx) { }
162
child = null;