Difference between revisions of "Headless"
(Created page with "''modo'' 302 introduced "'headless'" operation, allowing modo to act as a command line program with no graphical user interface. == Preface == Various command line switches a...")
Revision as of 17:42, 31 March 2012
modo 302 introduced "'headless'" operation, allowing modo to act as a command line program with no graphical user interface.
Various command line switches are also used in this article. Many of these switches also work with the full GUI mode as well. You should be comfortable with the MS-DOS prompt in Windows and the Terminal in OS X to use headless mode. The MS-DOS prompt and Terminal will henceforth be referred to as the command line or console.
The headless mode still requires a normal modo license to operate, and will fail with a license not found error if none is present.
Console mode uses its own config file. For modo 501 on Windows, this is modo_cl501.cfg, while on OS X this would be com.luxology.modo_cl501.
Telnet vs. Headless
Telnet operates very similar to headless mode, except that telnet can also be used from the GUI. The way commands are sent to and output is received from modo is identical for both telnet and headless.
Headless modo is a separate executable. On Windows, it is modo_cl.exe, and is run just like any other command line program through the MS-DOS prompt.
On OS X, modo_cl is inside the application bundle, and can be run from the Terminal.
After modo finishes stating up, you’ll be greeted with the following lines, which include a start message containing the build number, followed by a line showing the registered name associated with the license modo is using.
@start modo [xxxxx] Luxology LLC John Smith >
modo is now ready to start accepting commands. You can type any normal, non-UI command here and it will execute normally, with its results returned through stout.
Exiting Headless Mode
You can quit headless mode just like you can in GUI mode, by executing the app.quit command. You may also be able to use ctrl-C to immediately terminate modo, but using app.quit ensures a proper shutdown.
app.quit @exit ok
Changing the Prompt
By default, modo shows an greater than symbol (>) when it is read for you to enter commands. You can use the -prompt switch to set the prompt to any character sequence you’d like. The following replaces the standard prompt with the string ready: and a space.