Regenerate list of SMART disk only if too old

This commit is contained in:
Jeremy Gardais 2020-03-11 11:20:26 +01:00
parent d49b19bdc4
commit 5c8a9f9bb5
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 5 additions and 3 deletions

View File

@ -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