osInfo() improved fqdn (linux)
This commit is contained in:
parent
bab409fbc1
commit
216eda32e1
@ -82,6 +82,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||
| 5.17.17 | 2023-06-03 | `osInfo()` improved fqdn (linux) |
|
||||
| 5.17.16 | 2023-05-30 | `usb()` fix parsing JSON (mac OS) |
|
||||
| 5.17.15 | 2023-05-29 | `powershell()` added NoProfile to speed up powershell (windows) |
|
||||
| 5.17.14 | 2023-05-29 | `diskLayout()`, `osInfo()` fix parsing issues (mac OS) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.17.17</th>
|
||||
<td>2023-06-03</td>
|
||||
<td><span class="code">osInfo()</span> improved fqdn (linux)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.17.16</th>
|
||||
<td>2023-05-30</td>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
<img class="logo" src="assets/logo.png" alt="logo">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.17.13</span></div>
|
||||
<div class="version">New Version: <span id="version">5.17.17</span></div>
|
||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||
</div>
|
||||
<div class="down">
|
||||
|
||||
@ -168,15 +168,21 @@ function getFQDN() {
|
||||
let fqdn = os.hostname;
|
||||
if (_linux || _darwin) {
|
||||
try {
|
||||
const stdout = execSync('hostname -f');
|
||||
fqdn = stdout.toString().split(os.EOL)[0];
|
||||
const stdout = execSync('hostnamectl --json short 2>/dev/null');
|
||||
const json = JSON.parse(stdout.toString());
|
||||
|
||||
fqdn = json['StaticHostname'];
|
||||
} catch (e) {
|
||||
util.noop();
|
||||
try {
|
||||
const stdout = execSync('hostname -f 2>/dev/null');
|
||||
fqdn = stdout.toString().split(os.EOL)[0];
|
||||
} catch (e) {
|
||||
util.noop();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_freebsd || _openbsd || _netbsd) {
|
||||
} if (_freebsd || _openbsd || _netbsd) {
|
||||
try {
|
||||
const stdout = execSync('hostname');
|
||||
const stdout = execSync('hostname 2>/dev/null');
|
||||
fqdn = stdout.toString().split(os.EOL)[0];
|
||||
} catch (e) {
|
||||
util.noop();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user