osInfo() fixed issue fqdn (openBSD)

This commit is contained in:
Sebastian Hildebrandt 2022-02-03 14:05:32 +01:00
parent 7be59121f7
commit ee24a2420c
4 changed files with 16 additions and 2 deletions

View File

@ -80,6 +80,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment | | Version | Date | Comment |
| -------------- | -------------- | -------- | | -------------- | -------------- | -------- |
| 5.11.1 | 2022-02-03 | `osInfo()` fixed issue fqdn (openBSD) |
| 5.11.0 | 2022-01-26 | `networkInterfaces()` added default property and parameter | | 5.11.0 | 2022-01-26 | `networkInterfaces()` added default property and parameter |
| 5.10.7 | 2022-01-21 | `processes()` reverted PR #560 (windows) | | 5.10.7 | 2022-01-21 | `processes()` reverted PR #560 (windows) |
| 5.10.6 | 2022-01-21 | `usb()` fix `users()` fix tty (windows) | | 5.10.6 | 2022-01-21 | `usb()` fix `users()` fix tty (windows) |

View File

@ -57,6 +57,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<th scope="row">5.11.1</th>
<td>2022-02-03</td>
<td><span class="code">osInfo()</span> fixed issue fqdn (openBSD)</td>
</tr>
<tr> <tr>
<th scope="row">5.11.0</th> <th scope="row">5.11.0</th>
<td>2022-01-26</td> <td>2022-01-26</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png"> <img class="logo" src="assets/logo.png">
<div class="title">systeminformation</div> <div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div> <div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.11.0</span></div> <div class="version">New Version: <span id="version">5.11.1</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> <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>
<div class="down"> <div class="down">

View File

@ -167,7 +167,7 @@ function getLogoFile(distro) {
function getFQDN() { function getFQDN() {
let fqdn = os.hostname; let fqdn = os.hostname;
if (_linux || _darwin || _freebsd || _openbsd || _netbsd) { if (_linux || _darwin) {
try { try {
const stdout = execSync('hostname -f'); const stdout = execSync('hostname -f');
fqdn = stdout.toString().split(os.EOL)[0]; fqdn = stdout.toString().split(os.EOL)[0];
@ -175,6 +175,14 @@ function getFQDN() {
util.noop(); util.noop();
} }
} }
if (_freebsd || _openbsd || _netbsd) {
try {
const stdout = execSync('hostname');
fqdn = stdout.toString().split(os.EOL)[0];
} catch (e) {
util.noop();
}
}
if (_windows) { if (_windows) {
try { try {
const stdout = execSync('echo %COMPUTERNAME%.%USERDNSDOMAIN%', util.execOptsWin); const stdout = execSync('echo %COMPUTERNAME%.%USERDNSDOMAIN%', util.execOptsWin);