2 LuCI - Lua Configuration Interface - aria2 support
4 Copyright 2014-2015 nanpuyue <nanpuyue@gmail.com>
5 Modified by kuoruan <kuoruan@gmail.com>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
14 module("luci.controller.aria2", package.seeall)
17 if not nixio.fs.access("/etc/config/aria2") then
21 local page = entry({"admin", "services", "aria2"}, cbi("aria2"), _("Aria2 Settings"))
24 entry({"admin", "services", "aria2", "status"}, call("status")).leaf = true
29 local sys = require "luci.sys"
30 local ipkg = require "luci.model.ipkg"
31 local http = require "luci.http"
32 local uci = require "luci.model.uci".cursor()
35 running = (sys.call("pidof aria2c > /dev/null") == 0),
36 yaaw = ipkg.installed("yaaw"),
37 webui = ipkg.installed("webui-aria2")
40 http.prepare_content("application/json")
41 http.write_json(status)