For this, H-Sphere control panel establishes an SSH connection with a Unix box and runs script-runner:ssh -a -x email@example.com /hsphere/shared/scripts/script-runner.plFurther, the control panel sends commands to the output stream of the SSH session and script-runner reads and performs the commands and then outputs.
The format of command passed to script-runner is:
It starts with the keyword COMMAND followed by actual command. Then, if necessary, it’s followed by the parameters that are numbered from 1 and further. All parts of the command are separated with the ampersand (&). The ‘=’ symbol is followed by the value. The command ends with the line feed character.
If the command requires standard input, you should set the INPUT parameter. Commands are passed in the 8-bit ASCII encoding. Command parameters and standard input are passed in the URL-encoding.
Script-runner returns output in the following format:
If there is an error during script execution, parameter ERROR will contain the error text and output code EXIT_CODE will be nonzero. OUTPUT is a standard script output.
To check if script-runner is ready to accept commands, use ‘PING’ command. You should get the ‘PONG’ output.
Script-runner 1.8 logs all executed scripts and their output. They can be found in the /var/log/scriptrunner directory on the box where script-runner is running.