Regenerate list of SMART disk only if too old
This commit is contained in:
parent
d49b19bdc4
commit
5c8a9f9bb5
|
@ -158,11 +158,13 @@ choose_correct_type() {
|
|||
# Create or empty previous files
|
||||
true > "${plugin_result}"
|
||||
true > "${plugin_state}"
|
||||
true > "${device_list}"
|
||||
regenerate_if_too_old "${device_list}" 1440
|
||||
true > "${drivedb_list}"
|
||||
|
||||
# Get the list of all available devices
|
||||
smartctl --scan >> "${device_list}"
|
||||
# Get the list of all available devices if the previous list was emptied
|
||||
if test ! -s "${device_list}"; then
|
||||
smartctl --scan >> "${device_list}"
|
||||
fi
|
||||
|
||||
# If the file is not empty
|
||||
if test -s "${device_list}"; then
|
||||
|
|
Loading…
Reference in New Issue