Changes

Line 259: Line 259:  
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:
 
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\":[\"590bde71578da2fabfe77ba86c00e4e5\", \"uci\", \"set\", { \"config\":\"<span style=color:orange>network</span>\", \"type\":\"<span style=color:orange>interface</span>\", \"match\": {\"ipaddr\":\"<span style=color:red>192.168.1.1</span>\"}, \"values\": {\"ipaddr\":\"<span style=color:green>192.168.56.1</span>\"} } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
   −
  curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\":[\"9704f676709d9dedc98d7718c4e3e7d2\", \"uci\", \"set\", { \"config\":\"<span style=color:orange>network</span>\", \"type\":\"<span style=color:orange>interface</span>\", \"match\": {\"ipaddr\":\"<span style=color:red>192.168.1.1</span>\"}, \"values\": {\"ipaddr\":"<span style=color:green>192.168.56.1</span>\"} } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
+
The sections highlighted in orange describe the config file's name and section (in this case, network config and interface section). Highlighted in red is the exact part of the config file that you wish to change (in this case, the router's LAN IP address, '''ipaddr'''). Finally, highlighted in green is the value that is to replace the old value (in this case, change the router's LAN IP address to 192.168.56.1). If the issued command was a success, you should see a Response like this:
   −
  curl -d "{\"jsonrpc\":\"2.0\", \"id\":1, \"method\":\"call\", \"params\":[\"590bde71578da2fabfe77ba86c00e4e5\", \"uci\", \"set\", { \"config\":\"<span style=color:orange>network</span>\", \"type\":\"<span style=color:orange>interface</span>\", \"match\": {\"ipaddr\":\"<span style=color:red>192.168.1.1</span>\"}, \"values\": {\"ipaddr\":\"<span style=color:green>192.168.56.1</span>\"} } ] }" http://<span style=color:black>192.168.1.1</span>/ubus
     −
The sections highlighted in orange describe the config file's name and section (in this case, network config and interface section). Highlighted in red is the exact part of the config file that you wish to change (in this case, the router's LAN IP address, '''ipaddr'''). Finally, highlighted in green is the value that is to replace the old value (in this case, change the router's LAN IP address to 192.168.56.1). If the issued command was a success, you should see a Response like this:
+
[[Image:Configuration examples json-rpc terminal uci set.png]]
    
</font>
 
</font>