serverinfo

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
        Returns status 0 if executed on server hardware
    --software [PATH]
        Returns status 0 if the root volume has a server OS installed
        Use optional argument PATH to specify mountpoint of alternate volume
    --configured [PATH]
        Returns status 0 if the server is configured
        Use optional argument PATH to specify mountpoint of alternate volume
    --perfmode
        Returns status 0 if the server performance mode is enabled
    --setperfmode BOOL
        Enables 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
        Prints the server install path prefix
    --productname
        Prints the server product name
    --shortversion
        Prints the short version
    --buildversion
        Prints the build version
    --minimumserverversion
        Prints the minimum server version for this os
    --plist
        Prints a plist containing server information about the running system
    --help|-h
        Prints 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:

system_profiler - Report system configuration
uname - Print operating system name.
hostname - Print or set system name.


Copyright © SS64.com 1999-2017
Some rights reserved