adapt overlay_usage to match the comments from luebeck
This commit is contained in:
parent
42c43ba2af
commit
4d747c09c4
@ -2,8 +2,4 @@ local fs = require "nixio.fs"
|
|||||||
local opkg = require "luci.model.ipkg"
|
local opkg = require "luci.model.ipkg"
|
||||||
|
|
||||||
local st = fs.statvfs(opkg.overlay_root())
|
local st = fs.statvfs(opkg.overlay_root())
|
||||||
local blocks = st.blockss or 0
|
return 1 - st.bfree / st.blocks
|
||||||
local bfree = st.bfree or 0
|
|
||||||
local used = ((blocks - bfree) / blocks)
|
|
||||||
|
|
||||||
return math.floor(used * 1000 + 0.5) / 1000
|
|
||||||
|
Loading…
Reference in New Issue
Block a user