10512 questions

12517 answers


22040 members

0 votes
263 views 2 comments

Is it possible to get the list of DHCP clients via a UCI command so that I can get de responce via a SMS.

I can get the list via de CLI with cat /tmp/dhcp.leases, but how to get the response in a SMS.

Regards, Toine

1 Answer

0 votes


Sadly there is no straight forward solution for your need.

I can provide the following command to read Configuration Files under the Config folder. But not any file located in any folder.

uci export dhcp

To read any file, you need a more elaborated script. And that script is not executable via SMS

Openwrt development example using uci library to read configuration files - Programmer Sought

Maybe this 3rd party examples can help you. And sorry for not having a straight forward answer to your requirement this time.

[OpenWrt Wiki] DNS and DHCP examples

[OpenWrt Wiki] How to get a list of connected clients?



I understand the example of ProgrammerSought. You write that it is not possible to call a script via SMS. So something like the following will not work, correct?

curl -X GET " myscript.sh"

If the above does not work, is it possible that I create my own section via UCI, e.g. uci add mysection.senddhcplist and then sms: uci set mysection.senddhcplist = 1

With a seperate script on the modem I check ' if (uci get mysection.senddhcplist = 1) then do something'

Is this a way to go, or are there easier ways.

Regards, Toine


Sadly there is not a known easier way than the one you described.