I need to evaluate if the OS X Server.app has been installed and if it has been started or not. This I need to do from within a shell script.
I could check for existing folder names, but I would expect it cannot truly make sure that the Server.app is installed and up and running so that I can run the
Anyone with a suggestion?
This is a follow-up question to my previous question: Configure the OS X Server from .pkg postinstall script
It can be determined by running the following command:
To evaluate the result of the command within a shell script use the -q option and encapsulate it in an if-statement:
serverinfogives two options to determine if the Server.app is just installed or configured:
So if the
serveradmin --configuredcommand "fails", you could check if is installed: