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
|
# Create or empty previous files
|
||||||
true > "${plugin_result}"
|
true > "${plugin_result}"
|
||||||
true > "${plugin_state}"
|
true > "${plugin_state}"
|
||||||
true > "${device_list}"
|
regenerate_if_too_old "${device_list}" 1440
|
||||||
true > "${drivedb_list}"
|
true > "${drivedb_list}"
|
||||||
|
|
||||||
# Get the list of all available devices
|
# Get the list of all available devices if the previous list was emptied
|
||||||
|
if test ! -s "${device_list}"; then
|
||||||
smartctl --scan >> "${device_list}"
|
smartctl --scan >> "${device_list}"
|
||||||
|
fi
|
||||||
|
|
||||||
# If the file is not empty
|
# If the file is not empty
|
||||||
if test -s "${device_list}"; then
|
if test -s "${device_list}"; then
|
||||||
|
|
Loading…
Reference in New Issue