ENH use exit code to query smartd
This commit is contained in:
parent
77f8d23a03
commit
a6d1175a73
|
@ -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 obj = common.make_text_row(point.x, y, width, 'SMART Daemon')
|
||||||
local update = function()
|
local update = function()
|
||||||
if main_state.trigger10 == 0 then
|
if main_state.trigger10 == 0 then
|
||||||
local pid = i_o.execute_cmd('pidof smartd', nil, '*n')
|
local rc = i_o.exit_code_cmd('pidof smartd > /dev/null')
|
||||||
common.text_row_set(obj, (pid == '') and 'Error' or 'Running')
|
common.text_row_set(obj, (rc == 0) and 'Running' or 'Error')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return common.mk_acc(
|
return common.mk_acc(
|
||||||
|
|
Loading…
Reference in New Issue