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

View File

@ -142,7 +142,10 @@ function fsSize(drive, callback) {
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => { execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
return line.startsWith('/'); return line.startsWith('/');
}).forEach((line) => { }).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) { } catch (e) {
util.noop(); util.noop();

View File

@ -180,7 +180,8 @@ function getFQDN() {
util.noop(); util.noop();
} }
} }
} if (_freebsd || _openbsd || _netbsd) { }
if (_freebsd || _openbsd || _netbsd) {
try { try {
const stdout = execSync('hostname 2>/dev/null'); const stdout = execSync('hostname 2>/dev/null');
fqdn = stdout.toString().split(os.EOL)[0]; fqdn = stdout.toString().split(os.EOL)[0];