1 May 1998: The _COMMAND add-on for SRE-http The _COMMAND add-on for SRE-http is used to remotely issue (through a web browser) OS/2 commands to your server. These can be ANY OS/2 command, as long as it does not require user input. Alternatively, you can "submit" REXX programs to your server. You can think _COMMAND as giving SRE-http a "batch Telnet" capability. Setting up and using _COMMAND is simple: 1)Unzip _COMMAND.ZIP to a temporary directory 2)Copy _COMMAND.CMD to your SRE-http "addon" directory (where you've installed SRE-http's configuration and add-on files), i.e.; D:\GOSERVE\ADDON) 3)Copy _COMMAND.HTM to your GoServe data directory. Running _COMMAND: * The simplest way of using _COMMAND is to point your browser at _COMMAND.HTM. You will be given two choices: entering an OS/2 command, or submitting a REXX program (which you write on the spot). In both cases, the output of the command (or program) will be returned to your browser. This includes most (but not all) error messages. * The "submit program option" is meant for small REXX programs that you write in a TEXTAREA on your browser. It should be a syntatically correct REXX program (errors will be trapped, with a simple error message returned). There are a few important points to consider when "submitting REXX programs": 1) Do NOT USE GoServe commands (such as EXTRACT) -- you WILL CRASH GoServe if you do! 2) To output results to the client (yourself), use the QUEUE command. For example: QUEUE 'The time is now ' time('n') * If your command (or REXX program) requires a long time to complete, GoServe might time out. If this happens, SRE-http will attempt to clean up the various pieces-- but there is a slight chance that the server will be slowed down (until the process you invoked is finished). * Feel free to modify _COMMAND.HTM -- the syntax is simple. For example, you can have several different commands submitted per request. * Note that the "default" directory for _COMMAND is the GoServe working directory (where you installed SRE-http) * If you like entering URL's by hand, you can make the following types of requests: http://your.server/_command?type+foo.bar where "type" can be any OS/2 command. Note the use of + instead of space characters (HTTP does not tolerate spaces in the request string). One nice trick is to issue two commands, by using the & character. For example: http://your.server/_command?copy+\www\index.htm+index.v1&dir+index.* * As with the DETACH command, you should only use this with commands that do not require further user input (i.e.; del d:\foo\bar will ask for a Yes/No response -- this response which will be echoed back to the client) A Note on Security: Obviously, the _COMMAND utility can be disasterously abused by nefarious individuals. By default, only SUPERUSERS are allowed to invoke the _COMMAND add-on. If you want, you can require additional privileges (see the top of _COMMAND.CMD for details).