fsSize: rw /snap issue fixed (linux)

This commit is contained in:
Sebastian Hildebrandt
2023-08-05 15:46:45 +02:00
parent 014d618d21
commit a0c41f51b9
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -142,7 +142,10 @@ function fsSize(drive, callback) {
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
return line.startsWith('/');
}).forEach((line) => {
osMounts[line.split(' ')[0]] = line.toLowerCase().indexOf('rw') >= 0;
osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]] ?? false;
if (line.toLowerCase().indexOf('/snap/') === -1) {
osMounts[line.split(' ')[0]] = ((line.toLowerCase().indexOf('rw,') >= 0 || line.toLowerCase().indexOf(' rw ') >= 0));
}
});
} catch (e) {
util.noop();
+2 -1
View File
@@ -180,7 +180,8 @@ function getFQDN() {
util.noop();
}
}
} if (_freebsd || _openbsd || _netbsd) {
}
if (_freebsd || _openbsd || _netbsd) {
try {
const stdout = execSync('hostname 2>/dev/null');
fqdn = stdout.toString().split(os.EOL)[0];