Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/dev/Unraid.net/myservers.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[api]
version="4.6.6"
version="4.4.1"
extraOrigins="https://google.com,https://test.com"
[local]
sandbox="yes"
Expand Down
2 changes: 1 addition & 1 deletion api/dev/states/myservers.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[api]
version="4.6.6"
version="4.7.0"
extraOrigins="https://google.com,https://test.com"
[local]
sandbox="yes"
Expand Down
21 changes: 21 additions & 0 deletions api/src/core/utils/validation/is-gui-mode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { execa } from 'execa';

import { internalLogger } from '@app/core/log.js';

/**
* Check if Unraid is in GUI mode by looking for the slim process.
* @returns true if Unraid is in GUI mode, false otherwise.
*/
const isGuiMode = async (): Promise<boolean> => {
try {
// Use pgrep to check if slim process is running
const { exitCode } = await execa('pgrep', ['slim'], { reject: false });
// exitCode 0 means process was found, 1 means not found
return exitCode === 0;
} catch (error) {
internalLogger.error('Error checking GUI mode: %s', error);
return false;
}
};

export default isGuiMode;
Loading
Loading