From a6d1175a73d2b67162fa812e1f94c21b8ad64f72 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 23 Jul 2022 19:32:20 -0400 Subject: [PATCH] ENH use exit code to query smartd --- src/modules/filesystem.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/filesystem.lua b/src/modules/filesystem.lua index 5a27ffe..8c36ebb 100644 --- a/src/modules/filesystem.lua +++ b/src/modules/filesystem.lua @@ -16,8 +16,8 @@ return function(config, main_state, common, width, point) local obj = common.make_text_row(point.x, y, width, 'SMART Daemon') local update = function() if main_state.trigger10 == 0 then - local pid = i_o.execute_cmd('pidof smartd', nil, '*n') - common.text_row_set(obj, (pid == '') and 'Error' or 'Running') + local rc = i_o.exit_code_cmd('pidof smartd > /dev/null') + common.text_row_set(obj, (rc == 0) and 'Running' or 'Error') end end return common.mk_acc(