ssh root@192.168.1.1
vi /usr/share/rpcd/acl.d/anonymous.json
service rpcd restart && service uhttpd restart
curl http://192.168.1.1/ubus --json @payload.json
curl http://192.168.1.1/ubus --json @restart.json
| { | |
| "unauthenticated": { | |
| "description": "allow anonymous user to run program", | |
| "write": { | |
| "ubus": { | |
| "file": ["exec"], | |
| "rc": ["init"] | |
| }, | |
| "file": { | |
| "/path/to/your/program": ["exec"] | |
| } | |
| } | |
| } | |
| } |
| { | |
| "jsonrpc": "2.0", | |
| "id": 1, | |
| "method": "call", | |
| "params": [ | |
| "00000000000000000000000000000000", | |
| "file", | |
| "exec", | |
| { | |
| "command": "/path/to/your/program", | |
| "params": ["arg1", "arg2", "arg3"] | |
| } | |
| ] | |
| } |
| { | |
| "jsonrpc": "2.0", | |
| "id": 1, | |
| "method": "call", | |
| "params": [ | |
| "00000000000000000000000000000000", | |
| "rc", | |
| "init", | |
| { | |
| "name": "shadowsocks", | |
| "action": "restart" | |
| } | |
| ] | |
| } |