This section describes the CLI-PHP interface for Version 2, the general usage (GET requests) is defined
as follows:
Usage:
http (s)://cli.php?<key1>=<value1>&<key2>=<value2>..<keyN>=<
valueN>
Available keys:
output
Output format ( html, plain )
usr
Username to be used for authentication
pwd
Password to be used for authentication
commandV
Command to be executed
arg0..arg31
Arguments passed to commands
Notes:
The commands correspond to CLI commands as seen by 'cli −l', the arguments
(arg0..arg31) will be directly passed to the cli application
Thus, an URL containing the following sequence:
command=get&arg0=admin.password&arg1=admin.debug&arg2=admin.access
will lead to cli being called as:
$ cli get "admin.password" "admin.debug" "admin.access"
It supports whitespaces but please be aware that any special characters in the URL
must be specified according to RFC1738 (which usually done by common clients such
as wget, lynx, curl).
Response:
The returned response will always contain a status line in the format:
<return>: <msg>
with return values of OK if succeeded and ERROR if failed. Any output from the
commands will be appended
Examples:
OK: status command successful
ERROR: authentication failed
status – Display status information
Key usage:
command=status[&arg0=<section>]
Notes:
Available sections can be retrieved by running command=status&arg0=−h.
System status can be displayed without authentication.
Examples:
http://192.168.1.1/cli.php?version=2&output=html&usr=admin&pwd=admin01&command=
169
© RACOM s.r.o. – M!DGE2 GPRS/UMTS/HSPA+/LTE router
Command Line Interface
Summary of Contents for M!DGE2
Page 2: ......
Page 188: ...188 ...