aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Nazaryev <sergey@nazaryev.ru>2018-11-07 02:16:01 +0000
committerSergey Nazaryev <sergey@nazaryev.ru>2018-11-07 02:16:01 +0000
commit3288e58569b8cc8e33e53385ae3c820be0217a70 (patch)
treeb094bc9c25f824b48cf4de7c2c0831936c65156c
parent5e002c132b7d93f98efadd419f40ae763dd475ab (diff)
downloadifstat-3288e58569b8cc8e33e53385ae3c820be0217a70.zip
ifstat-3288e58569b8cc8e33e53385ae3c820be0217a70.tar.gz
ifstat-3288e58569b8cc8e33e53385ae3c820be0217a70.tar.bz2
Добавил env UBUS_SOCK для выбора кастомного сокета для ubus
-rwxr-xr-xifstat.lua2
-rwxr-xr-xifstatd.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/ifstat.lua b/ifstat.lua
index 1431acf..b01b2cd 100755
--- a/ifstat.lua
+++ b/ifstat.lua
@@ -105,7 +105,7 @@ end
function main()
uloop.init()
- local conn = ubus.connect()
+ local conn = ubus.connect(os.getenv("UBUS_SOCK"))
if not conn then
error("Failed to connect to ubus")
end
diff --git a/ifstatd.lua b/ifstatd.lua
index d899ac5..f42e104 100755
--- a/ifstatd.lua
+++ b/ifstatd.lua
@@ -124,7 +124,7 @@ end
local ubus_objects = { ifstat = {} }
local main_loop = function(BPF, config)
- local conn = ubus.connect()
+ local conn = ubus.connect(os.getenv("UBUS_SOCK"))
local iface = config["iface"]
local filters = config["filters"]