Changes

Line 248: Line 248:     
   curl -d "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"call\", \"params\": [\"a74c8e07646f0da2bfddce35bf3de1f3\", \"file\", \"exec\", {\"command\":\"<span style=color:orange>ls</span>\", \"params\": [\"<span style=color:orange>/etc/config</span>\"] } ] }" http://192.168.1.1/ubus
 
   curl -d "{\"jsonrpc\": \"2.0\", \"id\": 1, \"method\": \"call\", \"params\": [\"a74c8e07646f0da2bfddce35bf3de1f3\", \"file\", \"exec\", {\"command\":\"<span style=color:orange>ls</span>\", \"params\": [\"<span style=color:orange>/etc/config</span>\"] } ] }" http://192.168.1.1/ubus
 +
 +
[[Image:Configuration examples json-rpc terminal ls.png]]
 +
 +
The command is encapsulated in an orange rectangle and the answer in blue.
 +
 +
===Setting router parameters===
 +
 +
The UCI set command is used to set router parameters. As an example, lets try to change the router's LAN ip address. The command to do so looks like this:
 +
 +
 +
  curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\": [\"9704f676709d9dedc98d7718c4e3e7d2\", \"uci\", \"set\", {\"config\":\"network\", \"type\":\"interface\", \"match\": {\"ipaddr\": \"192.168.1.1\"}, \"values\": {\"ipaddr":"192.168.56.1\"} } ] }" http://192.168.1.1/ubus
 +
    
</font>
 
</font>