Browse Source

Add empty check

master v0.1.2
IamTheFij 4 years ago
parent
commit
432d5e1242
  1. 8
      encryption-check.sh

8
encryption-check.sh

@ -5,8 +5,12 @@ set -e
has_error=0
for file in $@ ; do
head -1 "$file" | grep --quiet '^\$ANSIBLE_VAULT;' || {
echo "ERROR: $file is not encrypted"
has_error=1
if [ -s "$file" ]; then
echo "ERROR: $file is not encrypted"
has_error=1
else
echo "WARNING: $file is not encrypted but is empty"
fi
}
done

Loading…
Cancel
Save