Line 95: |
Line 95: |
| [ | | [ |
| "<span style="color:orange">-q</span>" | | "<span style="color:orange">-q</span>" |
− | ]
| + | ] |
| } | | } |
| ] | | ] |
Line 110: |
Line 110: |
| You can issue almost any SSH command in a similar manner. For example, you wish to check the '''network''' config file. The SSH command to do so would be '''cat /etc/config/network''', which, translated to JSON-RPC, would be: | | You can issue almost any SSH command in a similar manner. For example, you wish to check the '''network''' config file. The SSH command to do so would be '''cat /etc/config/network''', which, translated to JSON-RPC, would be: |
| | | |
− | {
| + | { |
− | "jsonrpc": "2.0", "id": 1, "method": "call", "params":
| + | "jsonrpc": "2.0", "id": 1, "method": "call", "params": |
− | [
| + | [ |
− | "a74c8e07646f0da2bfddce35bf3de1f3", "file", "exec",
| + | "a74c8e07646f0da2bfddce35bf3de1f3", "file", "exec", |
− | {
| + | { |
− | "command":"<span style="color:orange">cat</span>",
| + | "command":"<span style="color:orange">cat</span>", |
− | "params":
| + | "params": |
− | [
| + | [ |
− | "<span style="color:orange">/etc/config/network</span>"
| + | "<span style="color:orange">/etc/config/network</span>" |
− | ]
| + | ] |
− | }
| + | } |
− | ]
| + | ] |
− | }
| + | } |
| The command and the parameter are highlighted in orange. In this case the Linux '''cat'''(short for “concatenate“) is used to view the contents of the '''/etc/config/network''' file. The Response is: | | The command and the parameter are highlighted in orange. In this case the Linux '''cat'''(short for “concatenate“) is used to view the contents of the '''/etc/config/network''' file. The Response is: |
| | | |