mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-20 18:06:05 -05:00
chore: df alternate to exclude memory (#7428)
This commit is contained in:
@@ -156,7 +156,7 @@ function linux_identifiers()
|
|||||||
// Fetch storage volumes using df
|
// Fetch storage volumes using df
|
||||||
child = require('child_process').execFile('/bin/sh', ['sh']);
|
child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||||
child.stdout.str = ''; child.stdout.on('data', dataHandler);
|
child.stdout.str = ''; child.stdout.on('data', dataHandler);
|
||||||
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.stdin.write('df -T -x tmpfs -x devtmpfs -x efivarfs | 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();
|
child.waitExit();
|
||||||
try { ret.volumes = JSON.parse(child.stdout.str.trim()); } catch (xx) { }
|
try { ret.volumes = JSON.parse(child.stdout.str.trim()); } catch (xx) { }
|
||||||
child = null;
|
child = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user