From 9bb443c6a67a9d4540c85b811bbe313a5f3be33d Mon Sep 17 00:00:00 2001 From: ohrensessel Date: Mon, 18 Aug 2014 13:08:54 +0200 Subject: [PATCH] adapt overlay_usage to match the comments from luebeck --- .../files/lib/gluon/announce/statistics.d/overlay_usage | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/gluon/gluon-announce/files/lib/gluon/announce/statistics.d/overlay_usage b/gluon/gluon-announce/files/lib/gluon/announce/statistics.d/overlay_usage index 6f1b7ed..f6cded2 100644 --- a/gluon/gluon-announce/files/lib/gluon/announce/statistics.d/overlay_usage +++ b/gluon/gluon-announce/files/lib/gluon/announce/statistics.d/overlay_usage @@ -2,8 +2,4 @@ local fs = require "nixio.fs" local opkg = require "luci.model.ipkg" local st = fs.statvfs(opkg.overlay_root()) -local blocks = st.blockss or 0 -local bfree = st.bfree or 0 -local used = ((blocks - bfree) / blocks) - -return math.floor(used * 1000 + 0.5) / 1000 +return 1 - st.bfree / st.blocks