libubox
C utility functions for OpenWrt.
json_script-example.json
Go to the documentation of this file.
1 [
2  [ "exec", "%EXECVAR%", "/%%/" ],
3  [ "if",
4  [ "eq", "EQVAR", "eqval" ],
5  [ "exec_if", "%VAR%", "%%", "jk" ]
6  ],
7  [ "case", "CASEVAR", {
8  "caseval0": ["cmd_case_0", "cmd_case_arg0", "case_cmd_arg1"],
9  "caseval1": ["cmd_case_1", "cmd_case_arg0", "case_cmd_arg1"]
10  } ],
11 
12  [ "if",
13  [ "and", [ "eq", "EQVAR", "eqval" ],
14  [ "has", "HASVAR" ],
15  [ "regex", "REGEXVAR0", "regexval" ],
16  [ "regex", "REGEXVAR1", [ "regexval10", "regexval11" ] ],
17  [ "not", [ "eq", "NOTEQVAR", "noteqval" ] ] ],
18  [ "exec_if_and", "%ANDVAR%" ]
19  ],
20 
21  [ "if",
22  [ "or", [ "eq", "EQVAR", "eqval" ],
23  [ "has", "HASVAR" ],
24  [ "regex", "REGEXVAR0", "regexval" ],
25  [ "regex", "REGEXVAR1", [ "regexval10", "regexval11" ] ],
26  [ "not", [ "eq", "NOTEQVAR", "noteqval" ] ] ],
27  [ "exec_if_or", "%ORVAR%" ]
28  ],
29 
30  [ "if",
31  [ "isdir", "%ISDIRVAR%" ],
32  [ "exec_isdir", "%ISDIRVAR%" ]
33  ],
34 
35  [ "return", "foobar" ],
36 
37  [ "exec_non_reachable", "Arghhh" ]
38 ]