Changes

no edit summary
Line 237: Line 237:  
         <td><i>weboff</i></td>
 
         <td><i>weboff</i></td>
 
         <td>Turns HTTP and HTTPS access off. This rule can also modified to turn of either HTTP or HTTPS separately.</td>
 
         <td>Turns HTTP and HTTPS access off. This rule can also modified to turn of either HTTP or HTTPS separately.</td>
 +
    </tr>
 +
    <tr>
 +
        <td><b>API</b></td>
 +
        <td><i>api</i></td>
 +
        <td>Is used to change the configuration settings on the device. [[#API_rule|Click here]] for more information on the UCI API rule.</td>
 
     </tr>
 
     </tr>
 
</table>
 
</table>
Line 428: Line 433:     
'''Disclaimer''': do not enclose values in '''escape characters''' like you would when executing UCI commands via CLI. For example: '''uci set network.mobile.apn="example"''' will cause an error in SMS API and your value will be altered, as a result, UCI commands execution will fail. Instead, simply write '''uci set network.mobile.apn=example''' without any escape characters or quotes.
 
'''Disclaimer''': do not enclose values in '''escape characters''' like you would when executing UCI commands via CLI. For example: '''uci set network.mobile.apn="example"''' will cause an error in SMS API and your value will be altered, as a result, UCI commands execution will fail. Instead, simply write '''uci set network.mobile.apn=example''' without any escape characters or quotes.
 +
 +
===API rule===
 +
----
 +
The <b>API</b> rule is used to configure any parameters on the device.
 +
 +
[[File:Networking rutos manual mobile utilities sms utilities modify sms rule api v1.png|border|class=tlt-border]]
 +
----
 +
The following are syntax examples for the API rule:
 +
 +
<table class="nd-othertables_2" style="width: 100%;">
 +
    <tr>
 +
        <th width=30%>Structure example</th>
 +
        <th width=35%>Description</th>
 +
        <th width=30%>SMS text example</th>
 +
    </tr>
 +
    <tr>
 +
        <td>uci <b>get</b> <config>.<section>.<option_name></td>
 +
        <td>Returns the value of a single configuration option.</td>
 +
        <td><li><i>uci get network.wan.ipaddr</i></li>Returns the router's WAN IP address.</td>
 +
    </tr>
 +
    <tr>
 +
        <td>uci <b>set</b> <config>.<section>.<option_name>="value"</td>
 +
        <td>Sets the value of a specified configuration option.</td>
 +
        <td><li><i>uci set network.mobile.apn=example</i></li>Changes mobile APN value to "example".</td>
 +
    </tr>
 +
    <tr>
 +
        <td>uci <b>show</b> <config></td>
 +
        <td>Returns the contents of a config file</td>
 +
        <td><li><i>uci show openvpn</i></li>Returns the contents of the "openvpn" config file.</td>
 +
    </tr>
 +
    <tr>
 +
        <td>uci <b>show</b> <config>.<section></td>
 +
        <td>Returns the exact part (section) of a config file.</td>
 +
        <td><li><i>uci show network.lan</i></li>Returns the configuration of the "lan" section from the "network" config file.</td>
 +
    </tr>
 +
<!--
 +
    <tr>
 +
        <td>uci <b>delete</b> <config>.<section></td>
 +
        <td>Deletes the specified section in a configuration file. To avoid operation issues, please use this command to delete optional configuration sections only (not mandatory ones).</td>
 +
        <td><li><i>uci delete network.lan4</i></li>Deletes a network interface called "lan4".</td>
 +
    </tr>
 +
    <tr>
 +
        <td>uci <b>delete</b> <config>.<section>.<option_name></td>
 +
        <td>Deletes the specified configuration option. To avoid operation issues, please use this command to delete optional configuration options only (not mandatory ones).</td>
 +
        <td><li><i>uci delete dhcp.lan.force</i></li>Deletes the "force" option for DHCP server of the "lan" interface (which in turn disables the "Force DHCP" function of that DHCP server).</td>
 +
    </tr>
 +
-->
 +
</table>
 +
 +
The UCI rule requires that you know the names of the configuration files and sections and parameters contained within them. You can find the config file list and some examples of the UCI system usage in our <b>[[UCI command usage]]</b> article.
    
===Custom Rules===
 
===Custom Rules===

Navigation menu