CLI commands for functions in Luci interface

Some functions are made available through the Luci interface and I am trying to determine if they have a corresponding CLI call that I could just run.

Example

Status -> Overview -> Associated Stations
Each current wifi client has a Disconnect button.

Is there a corresponding CLI call?
Can I determine this by analysing the Luci packages in some way?

Most of the commands are in /usr/sbin and /usr/bin

Read up on the commands
You can learn along by just browsing the dir tree

Edit : fixes typo

LuCI uses ubus call hostapd.wlanXX del_client for that, see https://github.com/openwrt/luci/blob/master/modules/luci-base/htdocs/luci-static/resources/network.js#L4106 (and https://github.com/openwrt/luci/blob/96a787999bf2b0313710101bb30cd42bbb2998da/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js#L95 for possible params).

1 Like

Typo /usr, of course.

1 Like

Also, when changing settings in LuCI, before you apply the changes, you can click Unsaved Changes at the top right corner to see the corresponding commands.

3 Likes

Thanks for the help.

I managed to create a command that seems to work (it took a while to determine how to format the parameters!)

ubus call hostapd.wlan1 del_client '{"addr":"XX:XX:XX:XX:XX:XX", "reason":1, "deauth":true, "ban_time":20000}'

Another question: How do you know that the call to rpc.declare in the code cited above translates into a ubus call?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.