add .editorconfig; remove trailing whitespace

add myself to license.txt
This commit is contained in:
Michael Schnerring
2020-09-08 16:00:05 +02:00
parent f07f20a864
commit 0b36a8658a
3 changed files with 37 additions and 25 deletions

12
.editorconfig Normal file
View File

@@ -0,0 +1,12 @@
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

View File

@@ -18,10 +18,10 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# #
# 2> Run times for large disks can take several days to complete, so it # 2> Run times for large disks can take several days to complete, so it
# is a good idea to use tmux sessions to prevent mishaps. # is a good idea to use tmux sessions to prevent mishaps.
# #
# 3> Must be run as 'root'. # 3> Must be run as 'root'.
# #
# 4> Tests of large drives can take days to complete: use tmux! # 4> Tests of large drives can take days to complete: use tmux!
# #
# Performs these steps: # Performs these steps:
@@ -30,7 +30,7 @@
# 2> Run badblocks # 2> Run badblocks
# 3> Run SMART extended test # 3> Run SMART extended test
# #
# The script sleeps after starting each SMART test, using a duration # The script sleeps after starting each SMART test, using a duration
# based on the polling interval reported by the disk, after which the # based on the polling interval reported by the disk, after which the
# script will poll the disk to verify the self-test has completed. # script will poll the disk to verify the self-test has completed.
# #
@@ -40,10 +40,10 @@
# You should monitor the burn-in progress and watch for errors, particularly # You should monitor the burn-in progress and watch for errors, particularly
# any errors reported by badblocks, or these SMART errors: # any errors reported by badblocks, or these SMART errors:
# #
# 5 Reallocated_Sector_Ct # 5 Reallocated_Sector_Ct
# 196 Reallocated_Event_Count # 196 Reallocated_Event_Count
# 197 Current_Pending_Sector # 197 Current_Pending_Sector
# 198 Offline_Uncorrectable # 198 Offline_Uncorrectable
# #
# These indicate possible problems with the drive. You therefore may # These indicate possible problems with the drive. You therefore may
# wish to abort the remaining tests and proceed with an RMA exchange # wish to abort the remaining tests and proceed with an RMA exchange
@@ -55,28 +55,28 @@
# #
# badblocks is invoked with a block size of 4096, the -wsv options, and # badblocks is invoked with a block size of 4096, the -wsv options, and
# the -o option to instruct it to write the list of bad blocks found (if # the -o option to instruct it to write the list of bad blocks found (if
# any) to a file named 'burnin-[model]_[serial number].bb'. # any) to a file named 'burnin-[model]_[serial number].bb'.
# #
# The only required command-line argument is the device specifier, e.g.: # The only required command-line argument is the device specifier, e.g.:
# #
# ./disk-burnin.sh sda # ./disk-burnin.sh sda
# #
# ...will run the burn-in test on device /dev/sda # ...will run the burn-in test on device /dev/sda
# #
# You can run the script in 'dry run mode' (see below) to check the sleep # You can run the script in 'dry run mode' (see below) to check the sleep
# duration calculations and to insure that the sequence of commands suits # duration calculations and to insure that the sequence of commands suits
# your needs. In 'dry runs' the script does not actually perform any # your needs. In 'dry runs' the script does not actually perform any
# SMART tests or invoke the sleep or badblocks programs. The script is # SMART tests or invoke the sleep or badblocks programs. The script is
# distributed with 'dry runs' enabled, so you will need to edit the # distributed with 'dry runs' enabled, so you will need to edit the
# Dry_Run variable below, setting it to 0, in order to actually perform # Dry_Run variable below, setting it to 0, in order to actually perform
# tests on drives. # tests on drives.
# #
# Before using the script on FreeBSD systems (including FreeNAS) you must # Before using the script on FreeBSD systems (including FreeNAS) you must
# first execute this sysctl command to alter the kernel's geometry debug # first execute this sysctl command to alter the kernel's geometry debug
# flags. This allows badblocks to write to the entire disk: # flags. This allows badblocks to write to the entire disk:
# #
# sysctl kern.geom.debugflags=0x10 # sysctl kern.geom.debugflags=0x10
# #
# Tested under: # Tested under:
# FreeNAS 9.10.2 (FreeBSD 10.3-STABLE) # FreeNAS 9.10.2 (FreeBSD 10.3-STABLE)
# Ubuntu Server 16.04.2 LTS # Ubuntu Server 16.04.2 LTS
@@ -94,7 +94,7 @@
# Uses: grep, pcregrep, awk, sed, tr, sleep, badblocks # Uses: grep, pcregrep, awk, sed, tr, sleep, badblocks
# #
# Written by Keith Nash, March 2017 # Written by Keith Nash, March 2017
# #
# KN, 8 Apr 2017: # KN, 8 Apr 2017:
# Added minimum test durations because some devices don't return accurate values. # Added minimum test durations because some devices don't return accurate values.
# Added code to clean up the log file, removing copyright notices, etc. # Added code to clean up the log file, removing copyright notices, etc.
@@ -102,16 +102,16 @@
# Emit test results after tests instead of full 'smartctl -a' output. # Emit test results after tests instead of full 'smartctl -a' output.
# Emit full 'smartctl -x' output at the end of all testing. # Emit full 'smartctl -x' output at the end of all testing.
# Minor changes to log output and formatting. # Minor changes to log output and formatting.
# #
# KN, 12 May 2017: # KN, 12 May 2017:
# Added code to poll the disk and check for completed self-tests. # Added code to poll the disk and check for completed self-tests.
# #
# As noted above, some disks don't report accurate values for the short and extended # As noted above, some disks don't report accurate values for the short and extended
# self-test intervals, sometimes by a significant amount. The original approach using # self-test intervals, sometimes by a significant amount. The original approach using
# 'fudge' factors wasn't reliable and the script would finish even though the SMART # 'fudge' factors wasn't reliable and the script would finish even though the SMART
# self-tests had not completed. The new polling code helps insure that this doesn't # self-tests had not completed. The new polling code helps insure that this doesn't
# happen. # happen.
# #
# Fixed code to work around annoying differences between sed's behavior on Linux and # Fixed code to work around annoying differences between sed's behavior on Linux and
# FreeBSD. # FreeBSD.
# #
@@ -128,7 +128,7 @@
# 1> Short SMART test # 1> Short SMART test
# 2> badblocks # 2> badblocks
# 3> Extended SMART test # 3> Extended SMART test
# #
######################################################################## ########################################################################
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
@@ -144,7 +144,7 @@ Drive=$1
Dry_Run=0 Dry_Run=0
# Directory specifiers for log and badblocks data files. Leave off the # Directory specifiers for log and badblocks data files. Leave off the
# trailing slash if you specify a value. Default is the current working # trailing slash if you specify a value. Default is the current working
# directory. # directory.
@@ -227,7 +227,7 @@ poll_selftest_complete()
# Return 0 if the test has completed, 1 if we exceed our polling timeout interval # Return 0 if the test has completed, 1 if we exceed our polling timeout interval
while [ $l_done -eq 0 ]; while [ $l_done -eq 0 ];
do do
smartctl -a /dev/"$Drive" | grep -i "The previous self-test routine completed" > /dev/null 2<&1 smartctl -a /dev/"$Drive" | grep -i "The previous self-test routine completed" > /dev/null 2<&1
l_status=$? l_status=$?
if [ $l_status -eq 0 ]; then if [ $l_status -eq 0 ]; then
@@ -235,7 +235,7 @@ poll_selftest_complete()
l_rv=0 l_rv=0
l_done=1 l_done=1
else else
# Check for failure # Check for failure
smartctl -a /dev/"$Drive" | grep -i "of the test failed." > /dev/null 2<&1 smartctl -a /dev/"$Drive" | grep -i "of the test failed." > /dev/null 2<&1
l_status=$? l_status=$?
if [ $l_status -eq 0 ]; then if [ $l_status -eq 0 ]; then
@@ -255,7 +255,7 @@ poll_selftest_complete()
done done
return $l_rv return $l_rv
} }
run_short_test() run_short_test()
{ {
@@ -367,4 +367,3 @@ if [ "${osflavor}" = "FreeBSD" ]; then
sed -i '' -e '/Vendor Specific SMART/d' "${Log_File}" sed -i '' -e '/Vendor Specific SMART/d' "${Log_File}"
sed -i '' -e '/SMART Error Log Version/d' "${Log_File}" sed -i '' -e '/SMART Error Log Version/d' "${Log_File}"
fi fi

View File

@@ -1,6 +1,7 @@
MIT License MIT License
Copyright (c) 2017 by Keith Nash Original work Copyright (c) 2017 by Keith Nash
Modified work Copyright (c) 2020 by Michael Schnerring
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal