[OpenWrt-Devel] [PATCH][libubox] json_script: add "isdir" support
Yousong Zhou
yszhou4tech at gmail.com
Sun Feb 14 22:13:20 EST 2016
On 15 February 2016 at 05:00, Felix Fietkau <nbd at openwrt.org> wrote:
> On 2016-02-13 11:08, Yousong Zhou wrote:
>> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
>> ---
>> This is intended for use by hotplug system to check whether
>> /etc/hotplug.d/%SUBSYSTEM% is a directory
>>
>> examples/json_script-example.json | 5 +++++
>> json_script.c | 26 ++++++++++++++++++++++++++
>> 2 files changed, 31 insertions(+)
>>
>> diff --git a/examples/json_script-example.json b/examples/json_script-example.json
>> index 45636b7..5328e59 100644
>> --- a/examples/json_script-example.json
>> +++ b/examples/json_script-example.json
>> @@ -27,6 +27,11 @@
>> [ "exec_if_or", "%ORVAR%" ]
>> ],
>>
>> + [ "if",
>> + [ "isdir", "%ISDIRVAR%" ],
>> + [ "exec_isdir", "%ISDIRVAR%" ]
> This exec line looks wrong, please fix.
>
It should be fine. handle_command cb from
examples/json_script-example.c will just print `exec_isdir` and its
eval'ed arguments.
yousong
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list