Luci / Custom Commands

e9hack e9hack at gmail.com
Fri Apr 16 08:22:46 BST 2021


Am 16.04.2021 um 08:49 schrieb Hannu Nyman:
> e9hack kirjoitti 16.4.2021 klo 8.37:
>> Hi,
>>
>> I want like to add the following command to Luci/Custom Commands:
>>
>> echo "/" > /proc/net/xt_recent/SSH_BLOCK
>>
>> But I can only add:
>>
>> echo "> /proc/net/xt_recent/SSH_BLOCK"
>>
>> How can I do it?
> 
> 
> I thought that easiest might be yo manually edit the uci config file, but I experience no difficulty even in LuCI with 21.02, when I test your example from GUI. It is visible in GUI, and gets in right format into /etc/config/luci
> 
> Also execution seems to go (I will send the screenshot separately as it might not get into).
> 
> So I am not sure what is the exact difficulty???   If the difficulty is in exeution, it might be about parsing uci / javascript with special chars like ">" and "/" plus passing them to the shell combo.
> 
> 
> One easy solution might to manually edit a script file with that required command  into /etc and then using LuCI only to execute that script.  The LuCI commands feature is not meant for really complex things.

It looks like the only solution is to put the line to a script file and execute this script file by LuCI / Custom commands.

Regards,
Hartmut



More information about the openwrt-devel mailing list