Server information.
Syntax serverinfo [options] command Options: --quiet|-q Prevent status messages from being printed to stdout Available commands (there must be exactly one): --hardware Return status 0 if executed on server hardware. --software [PATH] Return status 0 if the root volume has a server OS installed Use optional argument PATH to specify mountpoint of alternate volume. --configured [PATH] Return status 0 if the server is configured Use optional argument PATH to specify mountpoint of alternate volume. --perfmode Return status 0 if the server performance mode is enabled. --setperfmode BOOL Enable the server performance mode if BOOL is true All other values will disable the server performance mode Valid values of true (case-insensitive): TRUE, YES, enabled, on, 1 Returns status 0 if the mode is changed successfully. --prefix Print the server install path prefix. --productname Print the server product name. --shortversion Print the short version. --buildversion Print the build version. --minimumserverversion Print the minimum server version for this os. --plist Print a plist containing server information about the running system. --help|-h Print this usage message.
The -q quiet mode is intended for use in shell script conditionals.
Examples
Is performance mode enabled?:
$ if serverinfo -q --perfmode; then echo Performance mode enabled; else echo disabled; fi
Are we running on server hardware?:
$ serverinfo --hardware
$
if serverinfo -q --hardware; then echo Running on server hardware; fi
“The measure of your quality as a public person, as a citizen, is the gap between what you do and what you say” ~ Ramsey Clark
Related macOS commands:
system_profiler - Report system configuration.
w_vers - Print macOS operating system version.
uname - Print the Darwin OS Kernel version / release / machine name.
hostname - Print or set system name.