Add more prelims
This commit is contained in:
parent
bb7f613f0c
commit
0210515b8c
@ -27,12 +27,18 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
# For each file we're interested in
|
||||
# Iterate over each file we're interested in
|
||||
for file in /etc/shadow /etc/gshadow; do
|
||||
# Prelim check for zero-byte files (shouldn't proc)
|
||||
if ! [ -s "$file" ]; then
|
||||
echo "File is missing or empty: $file"
|
||||
continue
|
||||
fi
|
||||
# Prelim check to ensure we can read the file
|
||||
if ! [ -r "$file" ]; then
|
||||
echo "Unable to read file: $file"
|
||||
continue
|
||||
fi
|
||||
# Prelim checks succeeded, move forward
|
||||
echo "Parsing $file for junk"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user